Skip to main content

Module error

Module error 

Source
Expand description

Parameter and runtime errors for rustsim-crowd.

The primary use site is CrowdError returned by each model’s Params::validate(dt) method. Validating once at the start of a simulation catches the three classes of misconfiguration that otherwise surface as silent physics corruption:

  1. Non-positive physical parameters (mass ≤ 0, range ≤ 0, etc.): division by zero or negative relaxation, producing NaN velocities within a few ticks.
  2. CFL-like instability (dt * max_accel > max_speed): a single explicit-Euler tick can exceed the speed cap in one integration step, which is survivable thanks to clamp_speed but is a smell suggesting either a too-coarse dt or a too-stiff interaction.
  3. Non-finite dt: forwarded straight into the integrator.

All validators are cheap (a handful of comparisons) and deterministic.

Enums§

CrowdError
Errors surfaced by rustsim-crowd parameter validation.