pub struct ScenarioRunner { /* private fields */ }Expand description
Runs a scenario to completion and evaluates conditions.
Implementations§
Source§impl ScenarioRunner
impl ScenarioRunner
Sourcepub fn new(
scenario: Scenario,
dispatch: impl DispatchStrategy + 'static,
) -> Result<Self, SimError>
pub fn new( scenario: Scenario, dispatch: impl DispatchStrategy + 'static, ) -> Result<Self, SimError>
Create a new runner from a scenario definition and dispatch strategy.
Returns Err if the scenario’s config is invalid.
§Errors
Returns SimError::InvalidConfig if the scenario’s simulation config is invalid.
Sourcepub const fn sim(&self) -> &Simulation
pub const fn sim(&self) -> &Simulation
Access the underlying simulation.
Sourcepub fn run_to_completion(&mut self) -> ScenarioResult
pub fn run_to_completion(&mut self) -> ScenarioResult
Run to completion (all riders delivered or max_ticks reached).
Sourcepub fn evaluate(&self) -> ScenarioResult
pub fn evaluate(&self) -> ScenarioResult
Evaluate conditions against current metrics.
Auto Trait Implementations§
impl !Freeze for ScenarioRunner
impl !RefUnwindSafe for ScenarioRunner
impl Send for ScenarioRunner
impl Sync for ScenarioRunner
impl Unpin for ScenarioRunner
impl UnsafeUnpin for ScenarioRunner
impl !UnwindSafe for ScenarioRunner
Blanket Implementations§
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
Mutably borrows from an owned value. Read more