Skip to main content

Crate cobre_core

Crate cobre_core 

Source
Expand description

§cobre-core

Shared data model for the Cobre power systems ecosystem.

This crate defines the fundamental types used across all Cobre tools: buses, branches, generators (hydro, thermal, renewable), loads, network topology, and the top-level system struct. A power system defined with cobre-core types can be used for power flow analysis, optimization, dynamic simulation, and any other analysis procedure in the ecosystem.

§Design principles

  • Solver-agnostic: no solver or algorithm dependencies.
  • Validate at construction: invalid states are caught when building the system, not at solve time.
  • Shared types: a Hydro is the same struct whether used in stochastic optimization or steady-state analysis.
  • Declaration-order invariance: all entity collections are stored in canonical ID-sorted order so results are identical regardless of input ordering.

§Status

This crate is in early development. The API will change.

See the repository for the full roadmap.

Re-exports§

pub use entities::Bus;
pub use entities::ContractType;
pub use entities::DeficitSegment;
pub use entities::DiversionChannel;
pub use entities::EfficiencyModel;
pub use entities::EnergyContract;
pub use entities::FillingConfig;
pub use entities::GnlConfig;
pub use entities::HydraulicLossesModel;
pub use entities::Hydro;
pub use entities::HydroGenerationModel;
pub use entities::HydroPenalties;
pub use entities::Line;
pub use entities::NonControllableSource;
pub use entities::PumpingStation;
pub use entities::TailraceModel;
pub use entities::TailracePoint;
pub use entities::Thermal;
pub use entities::ThermalCostSegment;
pub use entity_id::EntityId;
pub use error::ValidationError;
pub use generic_constraint::ConstraintExpression;
pub use generic_constraint::ConstraintSense;
pub use generic_constraint::GenericConstraint;
pub use generic_constraint::LinearTerm;
pub use generic_constraint::SlackConfig;
pub use generic_constraint::VariableRef;
pub use initial_conditions::HydroStorage;
pub use initial_conditions::InitialConditions;
pub use penalty::GlobalPenaltyDefaults;
pub use penalty::HydroPenaltyOverrides;
pub use penalty::resolve_bus_deficit_segments;
pub use penalty::resolve_bus_excess_cost;
pub use penalty::resolve_hydro_penalties;
pub use penalty::resolve_line_exchange_cost;
pub use penalty::resolve_ncs_curtailment_cost;
pub use resolved::BusStagePenalties;
pub use resolved::ContractStageBounds;
pub use resolved::HydroStageBounds;
pub use resolved::HydroStagePenalties;
pub use resolved::LineStageBounds;
pub use resolved::LineStagePenalties;
pub use resolved::NcsStagePenalties;
pub use resolved::PumpingStageBounds;
pub use resolved::ResolvedBounds;
pub use resolved::ResolvedPenalties;
pub use resolved::ThermalStageBounds;
pub use scenario::CorrelationEntity;
pub use scenario::CorrelationGroup;
pub use scenario::CorrelationModel;
pub use scenario::CorrelationProfile;
pub use scenario::CorrelationScheduleEntry;
pub use scenario::ExternalSelectionMode;
pub use scenario::InflowModel;
pub use scenario::LoadModel;
pub use scenario::SamplingScheme;
pub use scenario::ScenarioSource;
pub use system::System;
pub use system::SystemBuilder;
pub use temporal::Block;
pub use temporal::BlockMode;
pub use temporal::NoiseMethod;
pub use temporal::PolicyGraph;
pub use temporal::PolicyGraphType;
pub use temporal::ScenarioSourceConfig;
pub use temporal::SeasonCycleType;
pub use temporal::SeasonDefinition;
pub use temporal::SeasonMap;
pub use temporal::Stage;
pub use temporal::StageRiskConfig;
pub use temporal::StageStateConfig;
pub use temporal::Transition;
pub use topology::BusGenerators;
pub use topology::BusLineConnection;
pub use topology::BusLoads;
pub use topology::CascadeTopology;
pub use topology::NetworkTopology;
pub use training_event::StoppingRuleResult;
pub use training_event::TrainingEvent;

Modules§

entities
Entity type definitions for all power system elements.
entity_id
Strongly-typed entity identifier used across all entity collections.
error
Error types produced during System construction and validation.
generic_constraint
User-defined generic linear constraints.
initial_conditions
Initial conditions for the optimization study.
penalty
Penalty resolution and pre-resolved penalty structures.
resolved
Pre-resolved penalty and bound containers for O(1) solver lookup.
scenario
Scenario pipeline raw data types — PAR model parameters, load statistics, and correlation model.
system
Top-level system struct and builder.
temporal
Temporal domain types — stages, blocks, seasons, and the policy graph.
topology
Topology representations for cascade and transmission network structures.
training_event
Typed event system for iterative optimization training loops and simulation runners.