flatland.envs.rail_env_utils module#
- flatland.envs.rail_env_utils.load_flatland_environment_from_file(file_name: str, load_from_package: str = None, obs_builder_object: ObservationBuilder = None, record_steps=False, skip_state_machine_update: bool = True) RailEnv[source]#
Parameters#
- file_namestr
The pickle file.
- load_from_packagestr
The python module to import from. Example: ‘env_data.tests’ This requires that there are __init__.py files in the folder structure we load the file from.
- obs_builder_object: ObservationBuilder
The obs builder for the RailEnv that is created.
- skip_state_machine_updatebool
Defaults to True: the returned env’s agent.state/agent.state_machine are never updated by step() (see RailEnvStateMachineWrapper) - step()’s own position/speed/reward/done control flow, and get_info_dict()’s state/action_required fields, are unaffected either way (both derived via EnvAgent.derived_state()). Pass False only if a caller needs agent.state/ agent.state_machine themselves (real state-machine semantics).
Returns#
- RailEnv
The environment loaded from the pickle file.