.. only:: comment © Crown-owned copyright 2023, Defence Science and Technology Laboratory UK .. _run a primaite session: .. admonition:: Deprecated :class: deprecated PrimAITE Session is being deprecated in favour of Jupyter Notebooks. The ``session`` command will be removed in future releases, but example notebooks will be provided to demonstrate the same functionality. Run a PrimAITE Session ====================== ``PrimaiteSession`` allows the user to train or evaluate an RL agent on the primaite simulation with just a config file, no code required. It manages the lifecycle of a training or evaluation session, including the setup of the environment, policy, simulator, agents, and IO. If you want finer control over the RL policy, you can interface with the :py:module::`primaite.session.environment` module directly without running a session. Run --- A PrimAITE session can be started either with the ``primaite session`` command from the cli (See :func:`primaite.cli.session`), or by calling :func:`primaite.main.run` from a Python terminal or Jupyter Notebook. There are two parameters that can be specified: - ``--config``: The path to the config file to use. If not specified, the default config file is used. - ``--agent-load-file``: The path to the pre-trained agent to load. If not specified, a new agent is created. Outputs ------- Running a session creates a session output directory in your user data folder. The filepath looks like this: ``~/primaite/3.0.0b6/sessions/YYYY-MM-DD/HH-MM-SS/``. This folder contains the simulation sys logs generated by each node, the saved agent checkpoints, and final model. The folder also contains a .json file for each episode step that contains the action, reward, and simulation state. These can be found in ``~/primaite/3.0.0b6/sessions/YYYY-MM-DD/HH-MM-SS/simulation_output/episode_/step_metadata/step_.json``