Struct sim_by_fired_event::Simulator [−][src]
simulator
Implementations
impl<M, E, Rec> Simulator<M, E, Rec> where
M: Model<Rec, ModelEvent = E>,
E: Event,
[src]
M: Model<Rec, ModelEvent = E>,
E: Event,
pub fn new<R: Rng + ?Sized>(rng: &mut R) -> Self where
Rec: Default,
M: Default,
[src]
Rec: Default,
M: Default,
create as default
pub fn create_from<R: Rng + ?Sized>(
rng: &mut R,
model: M,
recorder: Rec
) -> Self
[src]
rng: &mut R,
model: M,
recorder: Rec
) -> Self
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]
H: FnMut(&mut R, &mut M, &mut Rec, &mut EventScheduler<E>, Vec<(Priority, E)>),
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]
&mut self,
rng: &mut R,
counter: FC,
handler: H
) where
H: FnMut(&mut R, &mut M, &mut Rec, &mut EventScheduler<E>, Vec<(Priority, E)>),
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]
&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)>),
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]
&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)>),
run simulation with update model’s state
impl<M, E, Rec> Simulator<M, E, Rec> where
M: BulkEvents<Rec, E>,
E: Event,
[src]
M: BulkEvents<Rec, E>,
E: Event,
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]
&mut self,
rng: &mut R,
counter: FC
)
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]
&mut self,
rng: &mut R,
can_continue: F
) where
F: Fn(&M) -> bool,
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]
&mut self,
rng: &mut R,
update_state: F,
can_continue: P
) where
F: Fn(&mut M),
P: Fn(&M) -> bool,
run simulation with update model’s state
impl<M, E, Rec> Simulator<M, E, Rec> where
M: StepEachEvent<Rec, E>,
E: Event,
[src]
M: StepEachEvent<Rec, E>,
E: Event,
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]
&mut self,
rng: &mut R,
counter: FC
)
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]
&mut self,
rng: &mut R,
can_continue: F
) where
F: Fn(&M) -> bool,
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]
&mut self,
rng: &mut R,
update_state: F,
can_continue: P
) where
F: Fn(&mut M),
P: Fn(&M) -> bool,
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]
M: Model<Rec, ModelEvent = E>,
E: Event,
impl<M: Debug, E: Debug, Rec: Debug> Debug for Simulator<M, E, Rec> where
M: Model<Rec, ModelEvent = E>,
E: Event,
[src]
M: Model<Rec, ModelEvent = E>,
E: Event,
Auto Trait Implementations
impl<M, E, Rec> RefUnwindSafe for Simulator<M, E, Rec> where
E: RefUnwindSafe,
M: RefUnwindSafe,
Rec: RefUnwindSafe,
E: RefUnwindSafe,
M: RefUnwindSafe,
Rec: RefUnwindSafe,
impl<M, E, Rec> Send for Simulator<M, E, Rec> where
E: Send,
M: Send,
Rec: Send,
E: Send,
M: Send,
Rec: Send,
impl<M, E, Rec> Sync for Simulator<M, E, Rec> where
E: Sync,
M: Sync,
Rec: Sync,
E: Sync,
M: Sync,
Rec: Sync,
impl<M, E, Rec> Unpin for Simulator<M, E, Rec> where
E: Unpin,
M: Unpin,
Rec: Unpin,
E: Unpin,
M: Unpin,
Rec: Unpin,
impl<M, E, Rec> UnwindSafe for Simulator<M, E, Rec> where
E: UnwindSafe,
M: UnwindSafe,
Rec: UnwindSafe,
E: UnwindSafe,
M: UnwindSafe,
Rec: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,