pub enum Reason {
Guard {
rule: GuardRule,
since: Option<OffsetDateTime>,
},
User(UserOverride),
Plan {
plan: PlanId,
slot: Slot,
marginal_eur_per_kwh: Option<f64>,
},
Realtime(RealtimeCause),
Fallback(FallbackCause),
}Expand description
Why a setpoint has the value it has.
The variants are ordered by authority: a Reason::Guard value can never be
relaxed by anything below it. Reason::authority makes that order
machine-checkable, and hems-realtime asserts it on every tick.
Variants§
Guard
A grid or safety rule. Absolute — [BK6-22-300 A1 4.6 S. 3] requires that
a network operator’s reduction takes precedence over market-driven
control whenever it is the stricter of the two.
Fields
since: Option<OffsetDateTime>When the rule became active, where that is known.
User(UserOverride)
A person asked for it.
Plan
The optimiser’s plan for this slot.
Fields
marginal_eur_per_kwh: Option<f64>The marginal value of a kilowatt-hour in that slot, in €/kWh.
The price the plan faces in that slot, not a shadow price: a true dual needs a solver that exposes them, and the pure-Rust backend does not. It explains how much the plan cared, and it is what the guard weights a § 14a allocation by.
Realtime(RealtimeCause)
A correction inside the slot the plan could not anticipate.
Fallback(FallbackCause)
No plan was available.
Implementations§
Source§impl Reason
impl Reason
The authority this reason carries.
Sourcepub const fn guard_since(rule: GuardRule, since: OffsetDateTime) -> Self
pub const fn guard_since(rule: GuardRule, since: OffsetDateTime) -> Self
A guard reason that knows when it started.