Fix incorrect order in session from config
This commit is contained in:
@@ -88,16 +88,16 @@ class PrimaiteSession:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_config(cls, cfg: Dict, agent_load_path: Optional[str] = None) -> "PrimaiteSession":
|
def from_config(cls, cfg: Dict, agent_load_path: Optional[str] = None) -> "PrimaiteSession":
|
||||||
"""Create a PrimaiteSession object from a config dictionary."""
|
"""Create a PrimaiteSession object from a config dictionary."""
|
||||||
|
# READ IO SETTINGS (this sets the global session path as well) # TODO: GLOBAL SIDE EFFECTS...
|
||||||
|
io_settings = cfg.get("io_settings", {})
|
||||||
|
io_manager = SessionIO(SessionIOSettings(**io_settings))
|
||||||
|
|
||||||
game = PrimaiteGame.from_config(cfg)
|
game = PrimaiteGame.from_config(cfg)
|
||||||
|
|
||||||
sess = cls(game=game)
|
sess = cls(game=game)
|
||||||
|
sess.io_manager = io_manager
|
||||||
sess.training_options = TrainingOptions(**cfg["training_config"])
|
sess.training_options = TrainingOptions(**cfg["training_config"])
|
||||||
|
|
||||||
# READ IO SETTINGS (this sets the global session path as well) # TODO: GLOBAL SIDE EFFECTS...
|
|
||||||
io_settings = cfg.get("io_settings", {})
|
|
||||||
sess.io_manager.settings = SessionIOSettings(**io_settings)
|
|
||||||
|
|
||||||
# CREATE ENVIRONMENT
|
# CREATE ENVIRONMENT
|
||||||
if sess.training_options.rl_framework == "RLLIB_single_agent":
|
if sess.training_options.rl_framework == "RLLIB_single_agent":
|
||||||
sess.env = PrimaiteRayEnv(env_config={"game": game})
|
sess.env = PrimaiteRayEnv(env_config={"game": game})
|
||||||
|
|||||||
Reference in New Issue
Block a user