Trait TimeStepper

pub trait TimeStepper<F> {
    // Required methods
    fn advance(&mut self) -> Result<Option<NextTimePoint<F>>, TimeError>;
    fn get_last_full_save(&self) -> Option<(F, usize)>;
    fn initialize_bar(&self) -> Result<Bar, TimeError>;
    fn update_bar(&self, bar: &mut Bar) -> Result<(), Error>;
}
Expand description

Increments time of the simulation

In the future we hope to add adaptive steppers depending on a specified accuracy function.

Required Methods§

fn advance(&mut self) -> Result<Option<NextTimePoint<F>>, TimeError>

Advances the time stepper to the next time point. Also returns if there is an event scheduled to take place and the next time value and iteration number

fn get_last_full_save(&self) -> Option<(F, usize)>

Retrieved the last point at which the simulation was fully recovered. This might be helpful in the future when error handling is more mature and able to recover.

fn initialize_bar(&self) -> Result<Bar, TimeError>

Creates a bar that tracks the simulation progress

fn update_bar(&self, bar: &mut Bar) -> Result<(), Error>

Update a given bar to show the current simulation state

Implementors§

§

impl<F> TimeStepper<F> for FixedStepsize<F>
where F: Float + FromPrimitive,