pub enum CrowdError {
NonPositiveParam {
model: &'static str,
param: &'static str,
value: f64,
},
NegativeParam {
model: &'static str,
param: &'static str,
value: f64,
},
ZeroCount {
model: &'static str,
param: &'static str,
},
CflViolation {
model: &'static str,
product: f64,
max_speed: f64,
max_dt: f64,
},
InvalidDt {
model: &'static str,
dt: f64,
},
}Expand description
Errors surfaced by rustsim-crowd parameter validation.
This enum is deliberately flat (no nested error types, no Box<dyn Error>) so callers can match on it exhaustively. Every variant
carries the model name as its first field so a downstream error
message tells the operator which model’s Params is misconfigured
without having to walk a stack trace.
Variants§
NonPositiveParam
A strictly-positive parameter was given a zero or negative value.
Fields
NegativeParam
A non-negative parameter was given a negative value.
Fields
ZeroCount
A count-like parameter (number of candidates, number of directions) was given a zero value when it must be ≥ 1.
Fields
CflViolation
Explicit-Euler CFL-like condition violated.
For force-based models (Social Force, Generalized Centrifugal
Force) the per-tick velocity change is bounded by
dt * max_accel. If that bound exceeds max_speed the model
relies entirely on the post-integration clamp_speed call to
keep trajectories physical, which masks stiff interactions and
hides numerical blow-ups.
Fields
InvalidDt
dt is NaN, infinite, or non-positive.
Trait Implementations§
Source§impl Clone for CrowdError
impl Clone for CrowdError
Source§fn clone(&self) -> CrowdError
fn clone(&self) -> CrowdError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CrowdError
impl Debug for CrowdError
Source§impl Display for CrowdError
impl Display for CrowdError
Source§impl Error for CrowdError
impl Error for CrowdError
1.30.0 · 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()