Struct Simulation

Source
pub struct Simulation<'a> {
    pub configuration: ConfigurationValue,
    pub seed: usize,
    pub shared: SimulationShared,
    pub mutable: SimulationMut,
    pub warmup: Time,
    pub measured: Time,
    pub server_queue_size: usize,
    pub event_queue: EventQueue,
    pub statistics: Statistics,
    pub launch_configurations: Vec<ConfigurationValue>,
    pub plugs: &'a Plugs,
    pub memory_report_period: Option<Time>,
}
Expand description

The object representing the whole simulation.

Fields§

§configuration: ConfigurationValue

The whole parsed configuration.

§seed: usize

The seed of the random number generator.

§shared: SimulationShared

Encapsulated data of the simulation intended to be readable by many.

§mutable: SimulationMut

Encapsulated data intended to be mutable by any.

§warmup: Time

Cycles of preparation before the actual measured execution

§measured: Time

Cycles of measurement

§server_queue_size: usize

Maximum number of messages for generation to store in each server. Its default value is 20 messages. Attempts to generate traffic that fails because of the limit are tracked into the missed_generations statistic. Note that packets are not generated until it is the turn for the message to be sent to a router.

§event_queue: EventQueue

The queue of events guiding the simulation.

§statistics: Statistics

The statistics being collected.

§launch_configurations: Vec<ConfigurationValue>

Information abut how to launch simulations to different systems.

§plugs: &'a Plugs

Plugged functions to build traffics, routers, etc.

§memory_report_period: Option<Time>

Number of cycles to wait between reports of memory usage.

Implementations§

Source§

impl<'a> Simulation<'a>

Source

pub fn new(cv: &ConfigurationValue, plugs: &'a Plugs) -> Simulation<'a>

Source

pub fn run(&mut self)

Run the simulations until it finishes.

Source

pub fn get_simulation_results(&self) -> ConfigurationValue

Get config value for the simulation results.

Trait Implementations§

Source§

impl<'a> Quantifiable for Simulation<'a>

Source§

fn total_memory(&self) -> usize

Get the total memory currently being employed by the implementing type. Both stack and heap.
Source§

fn print_memory_breakdown(&self)

Prints by stdout how much memory is used per component.
Source§

fn forecast_total_memory(&self) -> usize

Get an estimation on how much memory the type could reach during the simulation.

Auto Trait Implementations§

§

impl<'a> Freeze for Simulation<'a>

§

impl<'a> !RefUnwindSafe for Simulation<'a>

§

impl<'a> !Send for Simulation<'a>

§

impl<'a> !Sync for Simulation<'a>

§

impl<'a> Unpin for Simulation<'a>

§

impl<'a> !UnwindSafe for Simulation<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V