citylearn.internal.provenance module

Passive electricity provenance, definition 1.0.

An interval has a perfectly mixed AC bus per member. Storage is proportionally mixed and its operations remain ordered. An affine balance resolves same-step storage cycles without inventing solar energy or iterating physical actions. Only aggregate source/destination counters and active storage stocks are kept.

class citylearn.internal.provenance.CityLearnProvenanceService(env)[source]

Bases: object

Electrical boundary: active member AC buses and connected EV batteries.

assets()[source]
begin_step()[source]
get_metadata()[source]
reset(empty=False)[source]
settle()[source]

Record one completed interval, idempotently, before topology advances.

sink(owner, destination, bag)[source]
source(owner, bag)[source]
source_destinations()[source]

Sparse producer/recipient evidence, without an episode-sized matrix.

summary()[source]

Destination attribution by recipient; producer identity stays in bags.

The cohort identity is all PV generated since reset. Initial/external inventories are unknown, even if their historical origin was renewable.

synchronize()[source]

Reconcile arrivals/departures/topology before an action or evaluation.

Departure inventory leaves as mobility delivery, not inferred trip use. Imposed arrival SOC replaces the old cohort with unknown external energy.

class citylearn.internal.provenance.Stock(battery: object, owner: str, kind: str, bag: dict = <factory>, step: int = -1, cursor: int = 0, connection: object = None)[source]

Bases: object

bag: dict
battery: object
connection: object = None
cursor: int = 0
kind: str
owner: str
step: int = -1
citylearn.internal.provenance.add(target, source, scale=1.0)[source]
citylearn.internal.provenance.energy(bag)[source]
citylearn.internal.provenance.scaled(bag, factor)[source]