Struct sim_by_fired_event::Simulator[][src]

pub struct Simulator<M, E, Rec> where
    M: Model<Rec, ModelEvent = E>,
    E: Event
{ /* fields omitted */ }

simulator

Implementations

impl<M, E, Rec> Simulator<M, E, Rec> where
    M: Model<Rec, ModelEvent = E>,
    E: Event
[src]

pub fn new<R: Rng + ?Sized>(rng: &mut R) -> Self where
    Rec: Default,
    M: Default
[src]

create as default

pub fn create_from<R: Rng + ?Sized>(
    rng: &mut R,
    model: M,
    recorder: Rec
) -> Self
[src]

create simulator from model

pub fn get_model(&self) -> &M[src]

getter for model

pub fn get_scheduler(&self) -> &EventScheduler<E>[src]

getter for scheduler

pub fn get_recorder(&self) -> &Rec[src]

getter for recorder

pub fn get_recorder_as_mut(&mut self) -> &mut Rec[src]

getter for recorder

pub fn swap_recorder(&mut self, new_recorder: Rec) -> Rec[src]

swap new and old recorder with get old recorder.

pub fn run_step<R: Rng + ?Sized, H>(&mut self, rng: &mut R, handler: H) where
    H: FnMut(&mut R, &mut M, &mut Rec, &mut EventScheduler<E>, Vec<(Priority, E)>), 
[src]

run simulate for one frame

pub fn run_n<R: Rng + ?Sized, FC: FrameCounter, H>(
    &mut self,
    rng: &mut R,
    counter: FC,
    handler: H
) where
    H: FnMut(&mut R, &mut M, &mut Rec, &mut EventScheduler<E>, Vec<(Priority, E)>), 
[src]

run simulate for frames

pub fn run_until<R: Rng + ?Sized, F, H>(
    &mut self,
    rng: &mut R,
    can_continue: F,
    handler: H
) where
    F: Fn(&M) -> bool,
    H: FnMut(&mut R, &mut M, &mut Rec, &mut EventScheduler<E>, Vec<(Priority, E)>), 
[src]

run simulation until condition is true

pub fn run_with_state<R: Rng + ?Sized, F, P, H>(
    &mut self,
    rng: &mut R,
    update_state: F,
    can_continue: P,
    handler: H
) where
    F: Fn(&mut M),
    P: Fn(&M) -> bool,
    H: FnMut(&mut R, &mut M, &mut Rec, &mut EventScheduler<E>, Vec<(Priority, E)>), 
[src]

run simulation with update model’s state

impl<M, E, Rec> Simulator<M, E, Rec> where
    M: BulkEvents<Rec, E>,
    E: Event
[src]

simulate for fired event with calculate in bulk

pub fn run_step_in_bulk_event<R: Rng + ?Sized>(&mut self, rng: &mut R)[src]

run simulate for one frame

pub fn run_n_in_bulk_event<R: Rng + ?Sized, FC: FrameCounter>(
    &mut self,
    rng: &mut R,
    counter: FC
)
[src]

run simulate for frames

pub fn run_until_in_bulk_event<R: Rng + ?Sized, F>(
    &mut self,
    rng: &mut R,
    can_continue: F
) where
    F: Fn(&M) -> bool
[src]

run simulation until condition is true

pub fn run_with_state_in_bulk_event<R: Rng + ?Sized, S, F, P>(
    &mut self,
    rng: &mut R,
    update_state: F,
    can_continue: P
) where
    F: Fn(&mut M),
    P: Fn(&M) -> bool
[src]

run simulation with update model’s state

impl<M, E, Rec> Simulator<M, E, Rec> where
    M: StepEachEvent<Rec, E>,
    E: Event
[src]

simulate for fired event with calculate each event

pub fn run_step_each_event<R: Rng + ?Sized>(&mut self, rng: &mut R)[src]

run simulate for one frame

pub fn run_n_each_event<R: Rng + ?Sized, FC: FrameCounter>(
    &mut self,
    rng: &mut R,
    counter: FC
)
[src]

run simulate for frames

pub fn run_until_each_event<R: Rng + ?Sized, F>(
    &mut self,
    rng: &mut R,
    can_continue: F
) where
    F: Fn(&M) -> bool
[src]

run simulation until condition is true

pub fn run_with_state_each_event<R: Rng + ?Sized, S, F, P>(
    &mut self,
    rng: &mut R,
    update_state: F,
    can_continue: P
) where
    F: Fn(&mut M),
    P: Fn(&M) -> bool
[src]

run simulation with update model’s state

Trait Implementations

impl<M: Clone, E: Clone, Rec: Clone> Clone for Simulator<M, E, Rec> where
    M: Model<Rec, ModelEvent = E>,
    E: Event
[src]

impl<M: Debug, E: Debug, Rec: Debug> Debug for Simulator<M, E, Rec> where
    M: Model<Rec, ModelEvent = E>,
    E: Event
[src]

Auto Trait Implementations

impl<M, E, Rec> RefUnwindSafe for Simulator<M, E, Rec> where
    E: RefUnwindSafe,
    M: RefUnwindSafe,
    Rec: RefUnwindSafe

impl<M, E, Rec> Send for Simulator<M, E, Rec> where
    E: Send,
    M: Send,
    Rec: Send

impl<M, E, Rec> Sync for Simulator<M, E, Rec> where
    E: Sync,
    M: Sync,
    Rec: Sync

impl<M, E, Rec> Unpin for Simulator<M, E, Rec> where
    E: Unpin,
    M: Unpin,
    Rec: Unpin

impl<M, E, Rec> UnwindSafe for Simulator<M, E, Rec> where
    E: UnwindSafe,
    M: UnwindSafe,
    Rec: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,