citylearn.internal.robustness_history module
Lossless sparse journal of robustness applications, with compact sealed steps.
- class citylearn.internal.robustness_history.RobustnessHistory[source]
Bases:
MappingKeep actual step membership/order; share repeated strings and descriptors.
One step remains writable using the legacy sets/dictionaries for identical deduplication semantics. Advancing seals it into integer arrays. Descriptors are interned only when an application actually occurred; event definitions or RNG seeds never stand in for the journal. Older steps decode on demand.
Counts are accumulated when a step is sealed. Summaries add the open step without sealing/mutating it. Reopening a historical step invalidates totals; they are rebuilt once before reuse. Arbitrary earlier cutoffs use a bounded step-by-step scan, so terminal telemetry and completed intervals stay distinct.