Schema

The schema is a .json file containing key-value pairs that define the parameters to use in constructing a citylearn.citylearn.CityLearnEnv object (environment). The aim of the schema is to provide an interface that is analogous to the .idf used to define an EnergyPlus model.

Schema Definition

The key-value pairs in the schema are summarized in the table:

Key

Definition

root_directory

Absolute path to directory that contains the data files including the schema. Can be null if schema is supplied to citylearn.citylearn.CityLearnEnv constructor as a filepath.

central_agent

Set to true for centralized control architecture else false.

simulation_start_time_step

Time step in the data files to start the simulation from.

simulation_end_time_step

Time step in the data files to end the simulation at.

episode_time_steps

Either the number of time steps in an episode or list of episode start and end time steps between simulation_start_time_step and simulation_end_time_step

rolling_episode_split

True if episode sequences are split such that each time step is a candidate for episode_start_time_step otherwise, False to split episodes in steps of episode_time_steps

random_episode_split

True if episode splits are to be selected at random during training otherwise, False to select sequentially.

seconds_per_time_step

Used to define the time resolution of the data files.

observations

Used to define the observation space.

observations:<observation>:active

Set to true if named <observation> should be added to the observation space and provided to the agent else false.

observations:<observation>:shared_in_central_agent

Set to true if if named <observation> values will be common in all buildings.

actions

Used to define the action space.

actions:<action>:active

Set to true if agent will provide named <action> to environment.

agent

Used tp define control algorithm to use in simulation.

agent:type

Control algorithm class in citylearn.agents or user-defined algorithm class path.

agent:attributes

Used to define attributes/hyperparameters that are used to construct control algorithm class specified in agent:type.

agent:attributes:<attribute>

Value to set named <attribute> to in control algorithm.

reward_function

Used to define reward function to use in simulation.

reward_function:type

Reward function class in citylearn.reward_function or user-defined reward function class path.

reward_function:attributes

Used to define attributes/hyperparameters that are used to construct reward function class specified in reward_function:type.

reward_function:attributes:<attribute>

Value to set named <attribute> to in reward function.

buildings

Used tp define buildings to use in simulation.

buildings:<building_name>

Used to define the attributes of a building uniquely named <building_name>.

buildings:<building_name>:include

Set to true if <building_name> should be included in simulation.

buildings:<building_name>:energy_simulation

Filename of building data file for <building_name>. This file must be located in root_directory.

buildings:<building_name>:weather

Filename of weather data file for <building_name>. This file must be located in root_directory.

buildings:<building_name>:carbon_intensity

Filename of carbon intensity data file for <building_name>. This file must be located in root_directory.

buildings:<building_name>:pricing

Filename of electricity pricing data file for <building_name>. This file must be located in root_directory.

buildings:<building_name>:type

<building_name> class in citylearn.building or user-defined building class path.

buildings:<building_name>:inactive_observations

List of building-specific inactive observations that overrides observations:<observation>:active.

buildings:<building_name>:inactive_actions

List of building-specific inactive actions that overrides actions:<action>:active.

buildings:<building_name>:<device>

Used to define a <device> for <building_name>. <device> can be cooling_device, heating_device, dhw_device, cooling_storage, heating_storage, dhw_storage, electrical_storage or pv.

buildings:<building_name>:<device>:type

<device> class in citylearn.energy_model or user-defined device class path.

buildings:<building_name>:<device>:autosize

Set to true if the <device> should be autosized for <building_name> else false.

buildings:<building_name>:<device>:autosize_attributes

Used to define attributes that are used to autosize <device> class specified in buildings:<building_name>:<device>:type.

buildings:<building_name>:<device>:autosize_attributes:<attribute>

Value to set named <attribute> to autosize <device> class specified in buildings:<building_name>:<device>:type.

buildings:<building_name>:<device>:attributes

Used to define attributes that are used to construct <device> class specified in buildings:<building_name>:<device>:type.

buildings:<building_name>:<device>:attributes:<attribute>

Value to set named <attribute> of <device> class specified in buildings:<building_name>:<device>:type.

buildings:<building_name>:dynamics

Used to define building temperature dynamics LSTM models.

buildings:<building_name>:dynamics:<mode>

Used to define building temperature dynamics LSTM model for specific HVAC mode where <mode> may be cooling or heating.

buildings:<building_name>:dynamics:<mode>:type

temperature dynamics class in citylearn.dynamics or user-defined dynamics class path.

buildings:<building_name>:dynamics:<mode>:attributes

Used to define attributes that are used to construct buildings:<building_name>:dynamics:<mode>:type.

buildings:<building_name>:power_outage

Used to define power outage preferences and stochastic model.

buildings:<building_name>:power_outage:simulate_power_outage

Whether to allow time steps when the grid is unavailable and loads must be met using only the building’s flexible resources.

buildings:<building_name>:power_outage:stochastic_power_outage

Whether to use a stochastic function to determine outage time steps otherwise, citylearn.building.Building.energy_simulation.power_outage time series is used.

buildings:<building_name>:power_outage:stochastic_power_outage_model

Used to define stochastic power outage model.

buildings:<building_name>:power_outage:stochastic_power_outage_model:type

Stochastic power outage model in citylearn.power_outage or user-defined model class path.

buildings:<building_name>:power_outage:stochastic_power_outage_model:attributes

Used to define attributes/hyperparameters that are used to construct stochastic power outage model class in buildings:<building_name>:power_outage:stochastic_power_outage_model:type.

An Example Schema

An example schema is shown below: