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§
Sourcepub fn is_link_cycle(&self, link_class: usize) -> bool
pub fn is_link_cycle(&self, link_class: usize) -> bool
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.
*
Sourcepub fn schedule_link_arrival(
&self,
link_class: usize,
event: Event,
) -> EventGeneration
pub fn schedule_link_arrival( &self, link_class: usize, event: Event, ) -> EventGeneration
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> 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
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>
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>
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