pub struct Runahead { /* private fields */ }
Expand description
Decides on the runahead for the next simulation round (the duration of the round).
Having a larger runahead improves performance since more hosts and more events can be run in parallel during a simulation round, but if the runahead is too large then packets will be delayed until the next simulation round which is beyond their intended latency. This uses a fixed runahead of the provided minimum possible latency when dynamic runahead is disabled, and otherwise uses a dynamic runahead of the minimum used latency. Both runahead calculations have a static lower bound.
Implementations§
source§impl Runahead
impl Runahead
pub fn new( is_runahead_dynamic: bool, min_possible_latency: SimulationTime, min_runahead_config: Option<SimulationTime>, ) -> Self
sourcepub fn get(&self) -> SimulationTime
pub fn get(&self) -> SimulationTime
Get the runahead for the next round.
sourcepub fn update_lowest_used_latency(&self, latency: SimulationTime)
pub fn update_lowest_used_latency(&self, latency: SimulationTime)
If dynamic runahead is enabled, will compare and update the stored lowest packet latency. This may shorten the runahead for future rounds.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Runahead
impl RefUnwindSafe for Runahead
impl Send for Runahead
impl Sync for Runahead
impl Unpin for Runahead
impl UnwindSafe for Runahead
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more