Struct SimulationShared

Source
pub struct SimulationShared {
    pub cycle: Time,
    pub network: Network,
    pub traffic: Box<dyn Traffic>,
    pub routing: Box<dyn Routing>,
    pub link_classes: Vec<LinkClass>,
    pub maximum_packet_size: usize,
    pub general_frequency_divisor: Time,
}
Expand description

Part of Simulation that is intended to be exposed to the Eventful::process API in a read-only way.

Fields§

§cycle: Time

The current cycle, i.e, the current discrete time.

§network: Network

The instantiated network. It contains the routers and servers connected according to the topology.

§traffic: Box<dyn Traffic>

The traffic being generated/consumed by the servers.

§routing: Box<dyn Routing>

The routing algorithm that the network router will employ to set candidate routes.

§link_classes: Vec<LinkClass>

The properties associated to each link class.

§maximum_packet_size: usize

The maximum size in phits that network packets can have. Any message greater than this is broken into several packets.

§general_frequency_divisor: Time

The base period of operation for the components. Defaults to 1, to allow having events every cycle. Components using this value will only execute at cycles multiple of it. This parameter allows to reduce the global frequency, allowing in turn to override some component to have greater frequency than the rest.

Implementations§

Source§

impl SimulationShared

Whether the current cycle is a multiple of the frequency divisor of the given link_class. These are the cycles in which it is allowed to send a phit through the link. The phit reception event should then be scheduled normally at cycle+delay. *

Schedule an event to be executed at the arrival across a link.
Counts both the wait for the time slot and the delay.

Auto Trait Implementations§

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