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§
Required Methods§
Sourcefn handle_micro_step_continue(
&mut self,
model: &M,
unchecked_executor: UncheckedActiveExecutor<E, M>,
) -> ContinuousStrategyResult<E, M, Self::Err>
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.