Full Reference Schema
examples/schema_full_reference.json
is a complete schema that writes out every option CityLearn reads. It runs as it is from a source checkout: it uses two
buildings (Building_1 and Building_4) and two EVs of the citylearn_challenge_2022_phase_all_plus_evs dataset.
Copy it, point root_directory at your data and change only what you need.
from citylearn.citylearn import CityLearnEnv
env = CityLearnEnv("examples/schema_full_reference.json")
JSON has no comments, so this page walks through the file section by section. Each block below is a part of the file (together they are the whole file), followed by what each key does, its default and its alternatives. The schema reference has the full rules.
How to read the values:
Where a key has a default, the file uses it. A
nullin device, charger and EVattributesmeans “use the default”, including defaults drawn from the random stream.Required keys without a default (file names, sizes, the time window) use the dataset’s values.
Features that are off by default (community market, demand response, robustness, outages, dynamic topology) are written out with
enabled: falseor empty lists, so you can see their shape and turn them on.The selection of active observations and actions is an example; every name is
falseby default.
Data location, seeds and versions
{
"root_directory": "../data/datasets/citylearn_challenge_2022_phase_all_plus_evs",
"random_seed": 2022,
"random_stream_version": "v2",
"physics_version": 2,
"baseline_version": 2
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
dataset folder, relative to the schema file |
the schema’s folder |
Every file name below is read from here. A |
|
|
a new random seed at each construction |
Set it for repeatable runs: drawn device parameters, EV initial SOC and drift, noise and random episodes depend on it. |
|
|
|
|
|
|
|
|
|
|
|
|
Agent layout, time window and episodes
{
"central_agent": false,
"interface": "flat",
"seconds_per_time_step": 3600,
"time_step_ratio_mode": "reject",
"simulation_start_time_step": 0,
"simulation_end_time_step": 8759,
"episode_time_steps": null,
"rolling_episode_split": false,
"random_episode_split": false,
"episode_split_boundary": "shared",
"ev_soc_carryover": false
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
required |
|
|
|
|
|
|
|
required |
Must equal the data step (hourly here). |
|
|
|
|
|
|
required |
Data rows, both inclusive: one year, 8759 control steps. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Calendar and dataset clock
{
"time_axis": {"calendar_file": null},
"timezone": null,
"dataset_seconds_per_time_step": null,
"dataset_contract_version": null,
"terminal_observation_padding": false,
"start_date": "2024-01-01"
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
none |
A CSV or Parquet calendar with |
|
|
none |
IANA name such as |
|
|
inferred from the calendar columns |
Declare the data step when |
|
|
none |
Metadata; a value starting with |
|
|
|
|
|
|
|
Date of row 0 in exported timestamps. It does not change the simulation. |
Reward and agent
{
"reward_function": {
"type": "citylearn.reward_function.RewardFunction",
"attributes": {"exponent": 1.0, "charging_constraint_penalty_coefficient": 1.0}
},
"agent": {"type": "citylearn.agents.baseline.BusinessAsUsualAgent", "attributes": {}}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
required |
Other classes: |
|
the two defaults of |
|
|
|
|
none |
Used by |
Observations
Every observation name CityLearn accepts in the catalogue is listed, except
occupant_interaction_indoor_dry_bulb_temperature_set_point_delta, which exists only for the occupant building type:
a name that a building cannot produce raises KeyError at construction, even when it is not active. active (default false) turns a name on for
every building that can produce it; shared_in_central_agent (default false) puts it once in the central vector when
central_agent is true. This file turns on a small example set and marks calendar, weather, price and carbon names
as shared, because they are the same for every building.
Names starting with electric_vehicle_, connected_electric_vehicle_at_charger_ and
incoming_electric_vehicle_at_charger_ are expanded per charger, deferrable_appliance_* per appliance and
escalator_* per escalator (for example electric_vehicle_charger_charger_1_1_connected_state). Electrical-service
observations are not listed here: electrical_service.observations switches them.
{
"observations": {
"month": {"active": true, "shared_in_central_agent": true},
"day_type": {"active": true, "shared_in_central_agent": true},
"hour": {"active": true, "shared_in_central_agent": true},
"minutes": {"active": false, "shared_in_central_agent": true},
"seconds": {"active": false, "shared_in_central_agent": true},
"daylight_savings_status": {"active": false, "shared_in_central_agent": true},
"outdoor_dry_bulb_temperature": {"active": true, "shared_in_central_agent": true},
"outdoor_dry_bulb_temperature_predicted_1": {"active": false, "shared_in_central_agent": true},
"outdoor_dry_bulb_temperature_predicted_2": {"active": false, "shared_in_central_agent": true},
"outdoor_dry_bulb_temperature_predicted_3": {"active": false, "shared_in_central_agent": true},
"outdoor_relative_humidity": {"active": false, "shared_in_central_agent": true},
"outdoor_relative_humidity_predicted_1": {"active": false, "shared_in_central_agent": true},
"outdoor_relative_humidity_predicted_2": {"active": false, "shared_in_central_agent": true},
"outdoor_relative_humidity_predicted_3": {"active": false, "shared_in_central_agent": true},
"diffuse_solar_irradiance": {"active": false, "shared_in_central_agent": true},
"diffuse_solar_irradiance_predicted_1": {"active": false, "shared_in_central_agent": true},
"diffuse_solar_irradiance_predicted_2": {"active": false, "shared_in_central_agent": true},
"diffuse_solar_irradiance_predicted_3": {"active": false, "shared_in_central_agent": true},
"direct_solar_irradiance": {"active": false, "shared_in_central_agent": true},
"direct_solar_irradiance_predicted_1": {"active": false, "shared_in_central_agent": true},
"direct_solar_irradiance_predicted_2": {"active": false, "shared_in_central_agent": true},
"direct_solar_irradiance_predicted_3": {"active": false, "shared_in_central_agent": true},
"electricity_pricing": {"active": true, "shared_in_central_agent": true},
"electricity_pricing_predicted_1": {"active": false, "shared_in_central_agent": true},
"electricity_pricing_predicted_2": {"active": false, "shared_in_central_agent": true},
"electricity_pricing_predicted_3": {"active": false, "shared_in_central_agent": true},
"carbon_intensity": {"active": true, "shared_in_central_agent": true},
"non_shiftable_load": {"active": true, "shared_in_central_agent": false},
"cooling_demand": {"active": false, "shared_in_central_agent": false},
"heating_demand": {"active": false, "shared_in_central_agent": false},
"dhw_demand": {"active": false, "shared_in_central_agent": false},
"indoor_dry_bulb_temperature": {"active": false, "shared_in_central_agent": false},
"indoor_relative_humidity": {"active": false, "shared_in_central_agent": false},
"average_unmet_cooling_setpoint_difference": {"active": false, "shared_in_central_agent": false},
"occupant_count": {"active": false, "shared_in_central_agent": false},
"indoor_dry_bulb_temperature_cooling_set_point": {"active": false, "shared_in_central_agent": false},
"indoor_dry_bulb_temperature_heating_set_point": {"active": false, "shared_in_central_agent": false},
"indoor_dry_bulb_temperature_cooling_delta": {"active": false, "shared_in_central_agent": false},
"indoor_dry_bulb_temperature_heating_delta": {"active": false, "shared_in_central_agent": false},
"comfort_band": {"active": false, "shared_in_central_agent": false},
"hvac_mode": {"active": false, "shared_in_central_agent": false},
"cooling_device_efficiency": {"active": false, "shared_in_central_agent": false},
"heating_device_efficiency": {"active": false, "shared_in_central_agent": false},
"dhw_device_efficiency": {"active": false, "shared_in_central_agent": false},
"cooling_electricity_consumption": {"active": false, "shared_in_central_agent": false},
"heating_electricity_consumption": {"active": false, "shared_in_central_agent": false},
"dhw_electricity_consumption": {"active": false, "shared_in_central_agent": false},
"cooling_storage_electricity_consumption": {"active": false, "shared_in_central_agent": false},
"heating_storage_electricity_consumption": {"active": false, "shared_in_central_agent": false},
"dhw_storage_electricity_consumption": {"active": false, "shared_in_central_agent": false},
"electrical_storage_electricity_consumption": {"active": false, "shared_in_central_agent": false},
"cooling_storage_soc": {"active": false, "shared_in_central_agent": false},
"heating_storage_soc": {"active": false, "shared_in_central_agent": false},
"dhw_storage_soc": {"active": false, "shared_in_central_agent": false},
"electrical_storage_soc": {"active": true, "shared_in_central_agent": false},
"solar_generation": {"active": true, "shared_in_central_agent": false},
"net_electricity_consumption": {"active": true, "shared_in_central_agent": false},
"power_outage": {"active": false, "shared_in_central_agent": false},
"power_outage_unserved_energy": {"active": false, "shared_in_central_agent": false},
"electric_vehicle_charger_connected_state": {"active": true, "shared_in_central_agent": false},
"connected_electric_vehicle_at_charger_departure_time": {"active": true, "shared_in_central_agent": false},
"connected_electric_vehicle_at_charger_required_soc_departure": {"active": true, "shared_in_central_agent": false},
"connected_electric_vehicle_at_charger_soc": {"active": true, "shared_in_central_agent": false},
"connected_electric_vehicle_at_charger_battery_capacity": {"active": false, "shared_in_central_agent": false},
"electric_vehicle_charger_incoming_state": {"active": false, "shared_in_central_agent": false},
"incoming_electric_vehicle_at_charger_estimated_arrival_time": {"active": false, "shared_in_central_agent": false},
"incoming_electric_vehicle_at_charger_estimated_soc_arrival": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_pending": {"active": true, "shared_in_central_agent": false},
"deferrable_appliance_running": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_can_start": {"active": true, "shared_in_central_agent": false},
"deferrable_appliance_deadline_missed": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_earliest_start_time_step": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_latest_start_time_step": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_deadline_time_step": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_hours_until_latest_start": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_hours_until_deadline": {"active": true, "shared_in_central_agent": false},
"deferrable_appliance_slack_steps": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_slack_ratio": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_urgency_ratio": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_cycle_duration_steps": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_cycle_energy_kwh": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_remaining_energy_kwh": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_current_step_energy_kwh": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_priority": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_must_run": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_cycle_average_power_kw": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_cycle_peak_power_kw": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_cycle_load_factor_ratio": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_cycle_peak_step_offset_ratio": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_remaining_duration_steps": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_remaining_average_power_kw": {"active": false, "shared_in_central_agent": false},
"deferrable_appliance_current_step_power_kw": {"active": false, "shared_in_central_agent": false},
"escalator_passengers_from_trains_15min": {"active": false, "shared_in_central_agent": false},
"escalator_background_pedestrians_15min": {"active": false, "shared_in_central_agent": false},
"escalator_passengers_expected_15min": {"active": false, "shared_in_central_agent": false},
"escalator_people_detected": {"active": false, "shared_in_central_agent": false},
"escalator_passing_trains": {"active": false, "shared_in_central_agent": false},
"escalator_minutes_to_next_train": {"active": false, "shared_in_central_agent": false},
"escalator_available": {"active": false, "shared_in_central_agent": false},
"escalator_state": {"active": false, "shared_in_central_agent": false},
"escalator_requested_state": {"active": false, "shared_in_central_agent": false},
"escalator_power_kw": {"active": false, "shared_in_central_agent": false},
"escalator_service_required": {"active": false, "shared_in_central_agent": false},
"escalator_service_met": {"active": false, "shared_in_central_agent": false},
"escalator_unserved_passengers_15min": {"active": false, "shared_in_central_agent": false}
}
}
See the observation catalogue for what each name means, and Observation bounds for their limits.
Actions
{
"actions": {
"cooling_or_heating_device": {"active": false},
"cooling_device": {"active": false},
"heating_device": {"active": false},
"cooling_storage": {"active": false},
"heating_storage": {"active": false},
"dhw_storage": {"active": false},
"electrical_storage": {"active": true},
"electric_vehicle_storage": {"active": true},
"deferrable_appliance": {"active": true},
"escalator": {"active": false}
}
}
Action |
Here |
Range and meaning |
|---|---|---|
|
off |
HVAC control; effective only for dynamics building types. |
|
off |
Charge (positive) or discharge (negative) the thermal storage. |
|
on |
[-1, 1] × battery |
|
on |
One action per charger: [-1, 1] × |
|
on |
One action per appliance: start the next cycle above |
|
off |
One action per escalator: standby, slow or normal. |
Entity bundles and derived forecasts
These keys are read only with "interface": "entity".
{
"observation_bundles": {
"entity_core_electrical": false,
"entity_community_operational": false,
"entity_forecasts_existing": false,
"entity_forecasts_derived": false,
"entity_temporal_derived": false,
"entity_action_feedback": false,
"entity_demand_response": false,
"entity_robustness": false
},
"derived_forecasts": {
"load_pv_method": "actual_future",
"persistence_period_seconds": 86400,
"cold_start": "current_step",
"price_source": "known_future_market_input",
"price_horizon_steps": [1, 2, 3]
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
all |
|
Turn on the feature groups you need; |
|
|
|
|
|
|
|
Persistence period. |
|
|
|
The only value. |
|
|
|
|
|
|
|
Lead of the three |
Topology
{"topology_mode": "static", "topology_events": []}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
|
|
|
|
|
|
Building_1: data and selection
{
"buildings": {
"Building_1": {
"include": true,
"type": "citylearn.building.Building",
"energy_simulation": "Building_1.csv",
"weather": "weather.csv",
"pricing": "pricing.csv",
"carbon_intensity": "carbon_intensity.csv",
"noise_std": 0.0,
"inactive_observations": [],
"inactive_actions": [],
"equity_group": null
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
|
|
|
|
the same |
|
|
dataset files |
required |
|
|
dataset files |
zero series |
With a zero series the cost or emissions ratios are NaN (0/0). |
|
|
|
Gaussian noise on weather, prices, carbon, PV profile and indoor conditions. |
|
|
|
Template names turned off for this building only. |
|
|
none |
|
Building_1: HVAC devices
Building_1 has no thermal demand in this dataset, so these devices only show the shape. On a building with demand,
size them or use "autosize": true.
{
"buildings": {
"Building_1": {
"cooling_device": {
"type": "citylearn.energy_model.HeatPump",
"autosize": false,
"autosize_attributes": {"safety_factor": 1.0},
"attributes": {
"nominal_power": 4.0,
"efficiency": null,
"target_heating_temperature": null,
"target_cooling_temperature": null
}
},
"heating_device": {
"type": "citylearn.energy_model.HeatPump",
"autosize": false,
"autosize_attributes": {"safety_factor": 1.0},
"attributes": {
"nominal_power": 4.0,
"efficiency": null,
"target_heating_temperature": null,
"target_cooling_temperature": null
}
},
"dhw_device": {
"type": "citylearn.energy_model.ElectricHeater",
"autosize": false,
"autosize_attributes": {"safety_factor": 1.0},
"attributes": {"nominal_power": 2.0, "efficiency": null}
}
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
required |
|
|
4 kW, 4 kW, 2 kW |
|
Electric input power. |
|
|
drawn: 0.2-0.3 (Carnot fraction) for heat pumps, 0.9-0.99 for heaters |
|
|
|
drawn: 45-50 °C and 7-10 °C |
Supply temperatures used for the COP. |
|
|
|
|
|
|
|
Multiplies the autosized power. |
Building_1: thermal storage
{
"buildings": {
"Building_1": {
"cooling_storage": {
"type": "citylearn.energy_model.StorageTank",
"autosize": false,
"autosize_attributes": {"safety_factor": null, "duration": 1.0},
"attributes": {
"capacity": 4.0,
"efficiency": null,
"loss_coefficient": null,
"initial_soc": null,
"max_input_power": null,
"max_output_power": null
}
},
"heating_storage": {
"type": "citylearn.energy_model.StorageTank",
"autosize": false,
"autosize_attributes": {"safety_factor": null, "duration": 1.0},
"attributes": {
"capacity": 4.0,
"efficiency": null,
"loss_coefficient": null,
"initial_soc": null,
"max_input_power": null,
"max_output_power": null
}
},
"dhw_storage": {
"type": "citylearn.energy_model.StorageTank",
"autosize": false,
"autosize_attributes": {"safety_factor": null, "duration": 1.0},
"attributes": {
"capacity": 2.0,
"efficiency": null,
"loss_coefficient": null,
"initial_soc": null,
"max_input_power": null,
"max_output_power": null
}
}
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
required |
|
|
4, 4 and 2 kWh |
|
Thermal energy. |
|
|
drawn in 0.90-0.98 |
Round trip. |
|
|
drawn in 0.001-0.009 per hour |
Standby loss. |
|
|
|
|
|
|
unlimited |
kW. |
|
|
drawn in 1-2 |
|
|
|
|
Hours of peak demand (physics version 2). |
Building_1: battery and PV
{
"buildings": {
"Building_1": {
"electrical_storage": {
"type": "citylearn.energy_model.Battery",
"autosize": false,
"autosize_attributes": {"duration": null, "parallel": false, "safety_factor": 1.0},
"attributes": {
"capacity": 6.4,
"nominal_power": 5.0,
"efficiency": null,
"depth_of_discharge": null,
"initial_soc": null,
"loss_coefficient": null,
"capacity_loss_coefficient": null,
"power_efficiency_curve": null,
"capacity_power_curve": null,
"discharge_power_curve": null,
"phase_connection": null
}
},
"pv": {
"type": "citylearn.energy_model.PV",
"autosize": false,
"autosize_attributes": {
"epw_filepath": null,
"use_sample_target": false,
"zero_net_energy_proportion": null,
"roof_area": null,
"safety_factor": 1.0
},
"attributes": {"nominal_power": 12.0, "generation_mode": "per_kw", "efficiency": null}
}
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
6.4 kWh, 5 kW |
|
A battery of size 0 cannot take the |
|
|
drawn in 0.90-0.98 |
Round trip; enter a one-way datasheet value squared. |
|
|
|
Discharge floor |
|
|
|
Start empty by default. |
|
|
drawn in 0.001-0.009 per hour |
|
|
|
drawn in 1e-5-1e-4 |
Capacity fade per equivalent full cycle. |
|
|
drawn curves |
Give them to make the battery independent of the seed. |
|
|
|
Physics version 1 uses |
|
|
|
Phase under the electrical service. |
|
|
Used only with |
|
|
12 kW |
|
|
|
|
|
|
|
|
drawn, not used |
|
|
|
PV autosizing needs an EPW weather file and |
Building_1: charger
{
"buildings": {
"Building_1": {
"chargers": {
"charger_1_1": {
"type": "citylearn.electric_vehicle_charger.Charger",
"charger_simulation": "charger_1_1.csv",
"soc_unit": null,
"noise_std": 0.0,
"attributes": {
"nominal_power": 11.0,
"max_charging_power": 11.0,
"min_charging_power": 1.4,
"max_discharging_power": 7.2,
"min_discharging_power": 0.0,
"efficiency": 0.95,
"charge_efficiency_curve": null,
"discharge_efficiency_curve": null,
"phase_connection": null,
"charger_type": 0
}
}
}
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
required |
|
|
|
required |
Schedule of the connected and incoming EVs. |
|
|
inferred per column |
|
|
|
|
Noise, in SOC percentage points, on the requested and arrival SOC. |
|
11 kW |
|
|
|
1.4 kW |
|
Requests below it give 0. |
|
7.2 kW |
|
Set above 0 for V2G or vehicle-to-building. |
|
|
|
|
|
0.95 |
|
Used where there is no curve. |
|
|
none |
|
|
|
|
|
|
|
none |
Label only. |
Building_1: deferrable appliance and escalators
{
"buildings": {
"Building_1": {
"deferrable_appliances": {
"deferrable_appliance_1": {
"type": "citylearn.energy_model.DeferrableAppliance",
"cycle_profiles_file": "deferrable_appliance_1_cycle_profiles.csv",
"flexibility_schedule_file": "deferrable_appliance_1_flexibility_schedule.csv",
"attributes": {"trigger_threshold": 0.5, "nominal_power": 0.0, "efficiency": null}
}
},
"escalators": {}
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
the same |
|
|
dataset files |
required |
Cycles and their windows. |
|
|
|
An action above it starts the next cycle. |
|
|
|
When above 0, every cycle’s peak power must fit under it. |
|
|
drawn, not used |
|
|
|
|
Escalators need a passenger file and the flat interface; see Escalators. |
Building_1: electrical service
{
"buildings": {
"Building_1": {
"electrical_service": {
"mode": "single_phase",
"default_split": "balanced",
"limits": {
"total": {"import_kw": 17.25, "export_kw": 6.9},
"per_phase": {
"L1": {"import_kw": 17.25, "export_kw": 6.9}
}
},
"available_grid_power": null,
"observations": {
"headroom": true,
"headroom_export": true,
"violation": true,
"phase_encoding": false,
"available_grid_power": true
}
}
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
|
|
|
|
|
Phase of load without a phase connection. |
|
17.25 kW, 6.9 kW |
no limit |
A 25 A single-phase connection with a 6.9 kW export limit. Leave a key out for no limit. |
|
17.25 kW, 6.9 kW |
no limit |
|
|
|
none |
A file (or |
|
|
|
Adds |
|
|
|
One-hot phase of each charger. |
Building_1: outages, dynamics and occupants
{
"buildings": {
"Building_1": {
"power_outage": {
"simulate_power_outage": false,
"stochastic_power_outage": false,
"stochastic_power_outage_model": {
"type": "citylearn.power_outage.ReliabilityMetricsPowerOutage",
"attributes": {"saifi": 1.436, "caidi": 331.2, "start_time_steps": null, "random_seed": null}
},
"vehicle_to_building": false
},
"dynamics": null,
"occupant": null,
"set_point_hold_time_steps": null,
"set_point_limits": [15.0, 30.0]
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
none |
For dynamics and occupant building types only. |
|
|
|
Occupant building types only. |
|
|
|
Occupant building types only; physics version 2. |
Building_4: the short form
Building_4 shows the same sections written with only the keys that have no default, and the legacy
charging_constraints (read only because the building has no electrical_service).
{
"buildings": {
"Building_4": {
"include": true,
"type": "citylearn.building.Building",
"energy_simulation": "Building_4.csv",
"weather": "weather.csv",
"pricing": "pricing.csv",
"carbon_intensity": "carbon_intensity.csv",
"electrical_storage": {
"type": "citylearn.energy_model.Battery",
"autosize": false,
"attributes": {"capacity": 6.4, "nominal_power": 5.0}
},
"pv": {
"type": "citylearn.energy_model.PV",
"autosize": false,
"attributes": {"nominal_power": 8.0}
},
"chargers": {
"charger_4_1": {
"type": "citylearn.electric_vehicle_charger.Charger",
"charger_simulation": "charger_4_1.csv",
"attributes": {
"nominal_power": 22.0,
"max_charging_power": 22.0,
"min_charging_power": 3.7,
"max_discharging_power": 22.0,
"min_discharging_power": 3.7,
"efficiency": 0.95
}
}
},
"charging_constraints": {
"building_limit_kw": null,
"phases": [{"name": "phase_1", "limit_kw": null, "chargers": ["charger_4_1"]}],
"expose_observations": true,
"observations": {"headroom": true, "headroom_export": false, "violation": true, "phase_encoding": false}
}
}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
no limit |
Limit on the building’s total charging power. |
|
one phase with |
|
|
|
|
|
Fallback for |
|
|
the same |
Electric vehicles and EV evaluation
{
"electric_vehicles_def": {
"Electric_Vehicle_7": {
"type": "citylearn.electric_vehicle.ElectricVehicle",
"include": true,
"battery": {
"type": "citylearn.energy_model.Battery",
"attributes": {
"capacity": 40.0,
"nominal_power": 50.0,
"initial_soc": null,
"depth_of_discharge": 1.0,
"loss_coefficient": 0.0,
"efficiency": null,
"capacity_loss_coefficient": null,
"power_efficiency_curve": null,
"capacity_power_curve": null,
"discharge_power_curve": null,
"random_seed": null
}
}
},
"Electric_Vehicle_8": {
"type": "citylearn.electric_vehicle.ElectricVehicle",
"include": true,
"battery": {
"type": "citylearn.energy_model.Battery",
"attributes": {
"capacity": 40.0,
"nominal_power": 50.0,
"initial_soc": null,
"depth_of_discharge": 1.0,
"loss_coefficient": 0.0,
"efficiency": null,
"capacity_loss_coefficient": null,
"power_efficiency_curve": null,
"capacity_power_curve": null,
"discharge_power_curve": null,
"random_seed": null
}
}
}
},
"ev_departure_within_tolerance": 0.05,
"ev_departure_service_tolerance": 0.05,
"business_as_usual_ev_charge_target": "full"
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
(EV ID) |
|
Must match the |
|
|
|
the same |
|
|
|
|
|
|
|
the same |
|
|
40 kWh, 50 kW |
required |
|
|
|
drawn in [0, 1] per EV from |
|
|
|
|
|
|
|
|
|
other |
|
as for the stationary battery |
|
|
|
|
SOC tolerances of the departure KPIs. The target met test uses 0.005, or the service tolerance if smaller. |
|
|
|
|
Community market
{
"community_market": {
"enabled": false,
"local_price_ratio_to_grid_import": 0.8,
"settlement_version": 1,
"grid_export_price": 0.0,
"tariff_files": {},
"local_trading_enabled": true,
"import_member_weights": {},
"kpis": {"community_local_traded_enabled": true, "community_self_consumption_enabled": true},
"matching_granularity": "aggregate_building",
"counterfactual": "grid_only"
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
|
|
|
|
|
Local price as a fraction of the grid import price. |
|
|
|
|
|
|
|
EUR/kWh for residual exports. |
|
|
|
Per-member price files. |
|
|
|
|
|
|
every member 1.0 |
Priority of importers for local energy. |
|
|
|
Report the local-traded and import-share KPIs. |
|
the only values |
the same |
Demand response
{
"demand_response": {
"enabled": false,
"requests_file": null,
"baseline_method": "rolling_pre_event_average",
"baseline_window_seconds": 3600,
"allow_overlapping_requests": false,
"request_purposes": {}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
|
|
|
|
none |
CSV or Parquet file of DSO/TSO requests. |
|
|
the same |
The only method. |
|
|
|
Window before each request for the baseline. |
|
|
|
Requests must not overlap. |
|
|
|
|
Robustness
{
"robustness": {
"enabled": false,
"events_file": null,
"random_seed": null,
"missing_replacement_value": -9999.0,
"modules": {
"observations": {"enabled": true},
"forecasts": {"enabled": true},
"actions": {"enabled": true},
"assets": {"enabled": true}
},
"agent_observation_contract": {"mode": "known_faults", "features": {}}
}
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
|
|
|
|
none |
CSV or Parquet file of observation, forecast, action and asset events. |
|
|
the root |
Seed of the event noise. |
|
|
|
Value of missing observations. |
|
|
|
Turn a module off without editing the events. |
|
|
|
|
|
|
|
Features visible under |
Outputs and diagnostics
{
"render_mode": "none",
"render": false,
"render_file_format": "csv",
"render_chunk_size": null,
"render_session_name": null,
"export_kpis_on_episode_end": false,
"evaluation_window": {"enabled": false},
"district_electrical_service": {"enabled": false, "limits": {"import_kw": null, "export_kw": null}},
"export_only_final_episode": true,
"debug_timing": false,
"check_observation_limits": false,
"physics_invariant_checks": false,
"energy_provenance": true,
"metrics_log_interval": 0
}
Key |
Here |
Default |
Notes and alternatives |
|---|---|---|---|
|
|
|
|
|
|
follows |
Legacy switch; wins over the constructor argument. |
|
|
|
|
|
|
100000 rows for CSV, 50000 for Parquet |
|
|
|
a timestamp |
Subfolder of the exports. |
|
|
follows rendering |
|
|
|
off |
|
|
disabled |
disabled |
|
|
|
|
For planned multi-episode runs. |
|
|
|
Timing fields in the step |
|
|
|
DEBUG logs for observations outside their bounds. |
|
|
|
Raise on an energy-balance violation. |
|
|
|
|
|
|
|
Log a summary line every N steps. |
Turning features on
To |
Change |
|---|---|
Train on random one-week episodes |
|
Reproduce CityLearn 3.6.0 |
|
Control both buildings with one agent |
|
Use entity tables |
|
Settle energy locally and pay exports |
|
Limit the grid connection of |
|
Allow V2G on |
set |
Simulate realistic outages |
|
Export time series at the end of each episode |
|
Check energy balances every step |
|