citylearn.simulator module

class citylearn.simulator.Simulator(env: citylearn.citylearn.CityLearnEnv, agent: citylearn.agents.base.Agent, episodes: Optional[int] = None, keep_env_history: Optional[bool] = None, logging_level: Optional[int] = None)[source]

Bases: object

property agent: citylearn.agents.base.Agent

Simulation agent(s) for env.buildings energy storage charging/discharging management.

property env: citylearn.citylearn.CityLearnEnv

Simulation environment.

property env_history: Tuple[citylearn.citylearn.CityLearnEnv]

List of env at the end of each episode.

property episodes: int

Number of times to simulate until terminal state is reached.

property keep_env_history: bool

Indicator to store env state at the end of each episode.

property logging_level: int

Logging level where increasing the level silences lower level information.


Run a CityLearn simulation.

Runs central or multi agent simulation.

citylearn.simulator.get_simulator(filepath: Union[str, pathlib.Path]) citylearn.simulator.Simulator[source]

Read and return pickled citylearn.simulator.Simulator object.


filepath (Union[str, Path]) – Path to pickle file.


simulatorcitylearn.simulator.Simulator object

Return type