citylearn.internal.demand_response module

class citylearn.internal.demand_response.CityLearnDemandResponseService(env: CityLearnEnv)[source]

Bases: object

Dataset-driven demand response requests and settlement.

DEFAULT_BASELINE_METHOD = 'rolling_pre_event_average'
DEFAULT_BASELINE_WINDOW_SECONDS = 3600.0
DIRECTION_CODES = {'down': -1.0, 'up': 1.0}
ISSUER_CODES = {'dso': 1.0, 'tso': 2.0}
get_metadata() Mapping[str, Any][source]
initialize()[source]

Load request definitions after env.root_directory is available.

observation_meta() Mapping[str, Any][source]
observation_values() Mapping[str, float][source]

Return current active DR fields for entity district observations.

property requests: Sequence[DemandResponseRequest]
reset()[source]

Reset episode-local state without reloading the dataset file.

settle_current_time_step()[source]

Measure and settle the current step after physical variables are updated.

property settlement_history: Sequence[Mapping[str, Any]]
summarize(building_names: Sequence[str]) Tuple[Mapping[str, Mapping[str, float]], Mapping[str, float]][source]
class citylearn.internal.demand_response.DemandResponseRequest(request_id: str, issuer: str, direction: str, start_time_step: int, end_time_step: int, target_power_kw: float, activation_price_eur_per_kwh: float, shortfall_penalty_eur_per_kwh: float, tolerance_power_kw: float, order: int)[source]

Bases: object

Canonical demand-response request loaded from a dataset file.

activation_price_eur_per_kwh: float
direction: str
end_time_step: int
issuer: str
order: int
request_id: str
shortfall_penalty_eur_per_kwh: float
start_time_step: int
target_power_kw: float
tolerance_power_kw: float