[][src]Trait caminos_lib::pattern::Pattern

pub trait Pattern: Quantifiable + Debug {
    pub fn initialize(
        &mut self,
        source_size: usize,
        target_size: usize,
        topology: &Box<dyn Topology>,
        rng: &RefCell<StdRng>
    );
pub fn get_destination(
        &self,
        origin: usize,
        topology: &Box<dyn Topology>,
        rng: &RefCell<StdRng>
    ) -> usize; }

A Pattern describes how a set of entities decides destinations into another set of entities. The entities are initially servers, but after some operators it may mean router, rows/columns, or other agrupations. The source and target set may be or not be the same. Or even be of different size. Thus, a Pattern is a generalization of the mathematical concept of function.

Required methods

pub fn initialize(
    &mut self,
    source_size: usize,
    target_size: usize,
    topology: &Box<dyn Topology>,
    rng: &RefCell<StdRng>
)
[src]

Fix the input and output size, providing the topology and random number generator. Careful with using toology in sub-patterns. For example, it may be misleading to use the dragonfly topology when building a pattern among groups or a pattern among the ruters of a single group. Even just a pattern of routers instead of a pattern of servers can lead to mistakes. Read the documentation of the traffic or meta-pattern using the pattern to know what its their input and output.

pub fn get_destination(
    &self,
    origin: usize,
    topology: &Box<dyn Topology>,
    rng: &RefCell<StdRng>
) -> usize
[src]

Obtain a destination of a source. This will be called repeteadly as the traffic requires destination for its messages.

Loading content...

Implementors

impl Pattern for CartesianTransform[src]

impl Pattern for ComponentsPattern[src]

impl Pattern for FileMap[src]

impl Pattern for ProductPattern[src]

impl Pattern for RandomInvolution[src]

impl Pattern for RandomPermutation[src]

impl Pattern for UniformPattern[src]

Loading content...