pub enum SimulationError {
LpInfeasible {
scenario_id: u32,
stage_id: u32,
solver_message: String,
},
SolverError {
scenario_id: u32,
stage_id: u32,
solver_message: String,
},
IoError {
message: String,
},
PolicyIncompatible {
message: String,
},
ChannelClosed,
Stochastic(StochasticError),
InvalidConfiguration(String),
}Expand description
Errors that can occur during simulation execution.
The fn simulate() function returns Result<SimulationSummary, SimulationError>.
All variants implement std::error::Error + Send + Sync + 'static.
Variants§
LpInfeasible
LP infeasibility at a simulation stage.
This indicates a system error — recourse slack variables (deficit, excess) should always make the LP feasible. If infeasibility occurs, it indicates a bug in LP construction or a degenerate system configuration. The error includes the scenario, stage, and solver diagnostic to aid debugging.
Fields
SolverError
LP solver returned an unexpected status (e.g., numerical difficulties, unbounded). Includes solver-specific diagnostics.
Fields
IoError
I/O failure during output writing (disk full, permission denied, Parquet encoding error). The simulation cannot continue if the output writer fails because results would be lost.
PolicyIncompatible
Policy compatibility validation failed (simulation-architecture.md SS2). The trained policy is incompatible with the current system configuration.
ChannelClosed
Channel send failure — the receiving end (I/O thread) has dropped unexpectedly. Indicates a panic or crash in the output writer.
Stochastic(StochasticError)
Forward sampler construction or sampling failure.
InvalidConfiguration(String)
Invalid configuration passed to simulate, e.g. baked-template slice length
does not match num_stages.
Trait Implementations§
Source§impl Debug for SimulationError
impl Debug for SimulationError
Source§impl Display for SimulationError
impl Display for SimulationError
Source§impl Error for SimulationError
impl Error for SimulationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<SimulationError> for SddpError
impl From<SimulationError> for SddpError
Source§fn from(err: SimulationError) -> Self
fn from(err: SimulationError) -> Self
Source§impl From<StochasticError> for SimulationError
impl From<StochasticError> for SimulationError
Source§fn from(source: StochasticError) -> Self
fn from(source: StochasticError) -> Self
Auto Trait Implementations§
impl Freeze for SimulationError
impl RefUnwindSafe for SimulationError
impl Send for SimulationError
impl Sync for SimulationError
impl Unpin for SimulationError
impl UnsafeUnpin for SimulationError
impl UnwindSafe for SimulationError
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more