[][src]Trait net_ensembles::sampling::traits::SimpleSample

pub trait SimpleSample {
    fn randomize(&mut self);

    fn simple_sample<F>(&mut self, times: usize, f: F)
    where
        F: FnMut(&Self)
, { ... }
fn simple_sample_vec<F, G>(&mut self, times: usize, f: F) -> Vec<G>
    where
        F: FnMut(&Self) -> G
, { ... } }

For easy sampling of your ensemble

Required methods

fn randomize(&mut self)

Randomizes self according to model

Loading content...

Provided methods

fn simple_sample<F>(&mut self, times: usize, f: F) where
    F: FnMut(&Self), 

do the following times times:

  1. f(self)
  2. self.randomize()

fn simple_sample_vec<F, G>(&mut self, times: usize, f: F) -> Vec<G> where
    F: FnMut(&Self) -> G, 

Loading content...

Implementors

impl<T, R> SimpleSample for ErEnsembleC<T, R> where
    T: Node + SerdeStateConform,
    R: Rng
[src]

fn randomize(&mut self)[src]

Randomizes the edges according to Er probabilities

  • this is used by ErEnsembleC::new to create the initial topology
  • you can use this for sampling the ensemble
  • runs in O(vertices * vertices)

impl<T, R> SimpleSample for ErEnsembleM<T, R> where
    T: Node + SerdeStateConform,
    R: Rng
[src]

fn randomize(&mut self)[src]

Randomizes self according to model

impl<T, R> SimpleSample for SwEnsemble<T, R> where
    T: Node + SerdeStateConform,
    R: Rng
[src]

fn randomize(&mut self)[src]

Randomizes the edges according to small-world model

  • this is used by SwEnsemble::new to create the initial topology
  • you can use this for sampling the ensemble
  • runs in O(vertices)
Loading content...