pub struct PolicyGraph {
pub graph_type: PolicyGraphType,
pub annual_discount_rate: f64,
pub transitions: Vec<Transition>,
pub season_map: Option<SeasonMap>,
}Expand description
Parsed and validated policy graph defining stage transitions, horizon type, and global discount rate.
This is the cobre-core clarity-first representation loaded from
stages.json. It stores the graph topology as specified by the
user. The solver-level HorizonMode enum (see Horizon Mode Trait
SS1) is built from this struct during initialization — it
precomputes transition maps, cycle detection, and discount factors
for efficient runtime dispatch.
Cross-reference: Horizon Mode Trait
defines the HorizonMode enum that interprets this graph structure.
Source: stages.json policy_graph.
See Input Scenarios §1.2.
Fields§
§graph_type: PolicyGraphTypeHorizon type: finite (acyclic chain) or cyclic (infinite periodic).
Determines which HorizonMode variant will be constructed at
solver initialization.
annual_discount_rate: f64Global annual discount rate.
Converted to per-transition factors using source stage durations:
d = 1 / (1 + annual_discount_rate)^dt.
A value of 0.0 means no discounting (d = 1.0 for all transitions).
For cyclic graphs, must be > 0 for convergence (validation rule 7).
See Discount Rate §3.
transitions: Vec<Transition>Stage transitions with probabilities and optional per-transition
discount rate overrides. For finite horizon, these form a linear
chain or DAG. For cyclic horizon, at least one transition has
source_id >= target_id (the back-edge).
season_map: Option<SeasonMap>Season definitions loaded from season_definitions in
stages.json. Required when PAR models or inflow history
aggregation are used. None when no season definitions are
provided and none are required.
Trait Implementations§
Source§impl Clone for PolicyGraph
impl Clone for PolicyGraph
Source§fn clone(&self) -> PolicyGraph
fn clone(&self) -> PolicyGraph
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more