Skip to main content

ContinueStrategy

Trait ContinueStrategy 

Source
pub trait ContinueStrategy<E, M: Model<E>, RunnerError> {
    type Err;

    // Required method
    fn handle_micro_step_continue(
        &mut self,
        model: &M,
        unchecked_executor: UncheckedActiveExecutor<E, M>,
    ) -> ContinuousStrategyResult<E, M, Self::Err>;
}
Expand description

A trait for defining strategies that decide whether to continue simulation execution after each micro-step.

By implementing this trait, you can flexibly customize simulation termination conditions, such as:

  • Limiting the total number of micro-steps.
  • Aborting execution when specific criteria are met.
  • Enforcing continuous execution regardless of state.

Required Associated Types§

Source

type Err

The error type associated with this strategy.

Required Methods§

Source

fn handle_micro_step_continue( &mut self, model: &M, unchecked_executor: UncheckedActiveExecutor<E, M>, ) -> ContinuousStrategyResult<E, M, Self::Err>

Invoked at the end of a micro-step to determine whether to continue.

§Arguments
  • model - A reference to the current model state.
  • unchecked_executor - The execution engine awaiting validation to proceed to the next step.
§Returns
  • Ok - The simulation is authorized to proceed to the next step.
  • Err - The simulation must be terminated based on the strategy’s logic.

Implementors§

Source§

impl<E, M: Model<E>, RunnerError> ContinueStrategy<E, M, RunnerError> for AlwaysContinueStrategy

Source§

type Err = RunnerError

Source§

impl<E, M: Model<E>, RunnerError> ContinueStrategy<E, M, RunnerError> for LimitAbortStrategy

Source§

impl<E, M: Model<E>, RunnerError> ContinueStrategy<E, M, RunnerError> for LimitDiscardStrategy

Source§

type Err = RunnerError