flatland.callbacks.generate_movie_callbacks module#

FlatlandCallbacks for rendering the env after each step and compiling movie when the episode is done.

class flatland.callbacks.generate_movie_callbacks.GenerateMovieCallbacks[source]#

Bases: FlatlandCallbacks

on_episode_end(*, env: RailEnv | None = None, data_dir: Path | None = None, **kwargs) None[source]#

Called when an episode is done (after terminated/truncated have been logged).

The exact time of the call of this callback is after env.step([action])

Parameters#

envEnvironment

the env

data_dirPath

trajectory data dir

kwargs:

Forward compatibility placeholder.

on_episode_start(*, env: RailEnv | None = None, data_dir: Path | None = None, **kwargs) None[source]#

Callback run right after an Episode has been started.

This method gets called after env.reset().

Parameters#

envEnvironment

the env

data_dirPath

trajectory data dir

kwargs:

Forward compatibility placeholder.

on_episode_step(*, env: RailEnv | None = None, data_dir: Path | None = None, **kwargs) None[source]#

Called on each episode step (after the action(s) has/have been logged).

This callback is also called after the final step of an episode, meaning when terminated/truncated are returned as True from the env.step() call.

The exact time of the call of this callback is after env.step([action]) and also after the results of this step (observation, reward, terminated, truncated, infos) have been logged to the given episode object.

Parameters#

envEnvironment

the env

data_dirPath

trajectory data dir

kwargs:

Forward compatibility placeholder.