Type Definition net_ensembles::watts_strogatz::WS
source · [−]pub type WS<T, R> = SmallWorldWS<T, R>;
Expand description
short for SmallWorldWS
See SmallWorldWS for the implemented traits
Implementations
sourceimpl<T, R> WS<T, R>
impl<T, R> WS<T, R>
sourcepub fn neighbor_distance(&self) -> NonZeroUsize
pub fn neighbor_distance(&self) -> NonZeroUsize
Returns neigbor distance of the initial ring
A neighbor distance of 1 means, in the original ring structure every node is connected to its two nearest neigbors, a neighbor distance of 2 means, it is connected to its 4 nearest neigbors and so on
The graph will contain neighbor_distance * system size (i.e. graph.vertex_count()) connections
sourcepub fn rewire_prob(&self) -> f64
pub fn rewire_prob(&self) -> f64
retunrs rewire probability the ensemble is set to
On average, a fraction of rewire_prob nodes should be rewired
sourceimpl<T, R> WS<T, R>where
T: Node,
R: Rng,
impl<T, R> WS<T, R>where
T: Node,
R: Rng,
sourcepub fn new(
n: u32,
neighbor_distance: NonZeroUsize,
rewire_probability: f64,
rng: R
) -> Result<Self, WSCreationError>
pub fn new(
n: u32,
neighbor_distance: NonZeroUsize,
rewire_probability: f64,
rng: R
) -> Result<Self, WSCreationError>
Initialize a WS - a small-world ensemble
n
is the system size, i.e., how many nodes there should be in the created graphsneighbor_distance
is needed for the initial ring structure. See also WS::neigbor_distancerewire_probability
- each edge will be rewired with a probability ofrewire_probability
- see also WS::rewire_probrng
- random number generator