SimpleTimingModel

Struct SimpleTimingModel 

Source
pub struct SimpleTimingModel<P: Prefix> { /* private fields */ }
Available on crate feature rand_queue only.
Expand description

Simple timing model based on a beta distribution.

The processing delay depends on a single beta distribution (see ModelParams) with parameters that can be tuned for each pair of routers.

Implementations§

Source§

impl<P: Prefix> SimpleTimingModel<P>

Source

pub fn new(default_params: ModelParams) -> Self

Create a new, empty model queue with given default parameters

Source

pub fn set_parameters( &mut self, src: RouterId, dst: RouterId, params: ModelParams, )

Set the parameters of a specific router pair.

Trait Implementations§

Source§

impl<P: Clone + Prefix> Clone for SimpleTimingModel<P>

Source§

fn clone(&self) -> SimpleTimingModel<P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug + Prefix> Debug for SimpleTimingModel<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, P> Deserialize<'de> for SimpleTimingModel<P>
where P: for<'a> Deserialize<'a> + Prefix,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<P: Prefix> EventQueue<P> for SimpleTimingModel<P>

Source§

type Priority = NotNan<f64>

Type of the priority.
Source§

fn push<Ospf: OspfProcess>( &mut self, event: Event<P, Self::Priority>, _routers: &BTreeMap<RouterId, Router<P, Ospf>>, _net: &PhysicalNetwork, )

Enqueue a new event.
Source§

fn pop(&mut self) -> Option<Event<P, Self::Priority>>

Pop the next event.
Source§

fn peek(&self) -> Option<&Event<P, Self::Priority>>

peek the next event. Read more
Source§

fn len(&self) -> usize

Get the number of enqueued events Read more
Source§

fn is_empty(&self) -> bool

Return True if no event is enqueued. Read more
Source§

fn clear(&mut self)

Remove all events from the queue.
Source§

fn get_time(&self) -> Option<f64>

Get the current time of the queue.
Source§

fn update_params<Ospf: OspfProcess>( &mut self, _: &BTreeMap<RouterId, Router<P, Ospf>>, _: &PhysicalNetwork, )

Update the model parameters. This function will always be called after some externally triggered event occurs. It will still happen, even if the network was set to manual simulation.
Source§

unsafe fn clone_events(&self, conquered: Self) -> Self

Clone all events from self into conquered. Read more
Source§

fn push_many<Ospf: OspfProcess>( &mut self, events: Vec<Event<P, Self::Priority>>, routers: &BTreeMap<RouterId, Router<P, Ospf>>, net: &PhysicalNetwork, )

Enqueue multiple events at once.
Source§

impl<P: Prefix> PartialEq for SimpleTimingModel<P>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<P> Serialize for SimpleTimingModel<P>
where P: Serialize + Prefix,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<P> Freeze for SimpleTimingModel<P>

§

impl<P> RefUnwindSafe for SimpleTimingModel<P>
where P: RefUnwindSafe,

§

impl<P> Send for SimpleTimingModel<P>

§

impl<P> Sync for SimpleTimingModel<P>

§

impl<P> Unpin for SimpleTimingModel<P>
where P: Unpin,

§

impl<P> UnwindSafe for SimpleTimingModel<P>
where P: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,