citylearn.internal.balance_audit module

Offline independent balance audit using a directed physical-flow network.

No production accounting, settlement or KPI formula is used to calculate expected values. Battery journals are physical measurements and are checked against device terminals and stored energy. This is model-consistency evidence, not calibration.

exception citylearn.internal.balance_audit.BalanceAuditError[source]

Bases: AssertionError

class citylearn.internal.balance_audit.FlowNetwork[source]

Bases: object

Solve concentrations from Kirchhoff balances on explicit operation nodes.

edge(source, target, amount)[source]
node(mass, inputs=None)[source]
sink(node, key, amount)[source]
solve(check)[source]
class citylearn.internal.balance_audit.IndependentBalanceAudit(env, *, absolute_tolerance=1e-05, relative_tolerance=1e-07)[source]

Bases: object

Attach after reset at interval zero; detach before resetting the episode.

The optional instrumentation observes both normal and no-feedback transitions. It adds no dispatch decisions and preserves the original runtime methods.

boundary()[source]
check(label, actual, expected)[source]
expected_rows()[source]
expected_summary()[source]
finish(*, check_kpis=True)[source]
prices(building, t)[source]
record()[source]
citylearn.internal.balance_audit.plus(target, values, factor=1.0)[source]
citylearn.internal.balance_audit.total(values)[source]
citylearn.internal.balance_audit.weighted_imports(demands, traded, weights)[source]

Independent progressive filling at demand-saturation breakpoints.