Struct net_ensembles::spacial::SpacialEnsemble [−][src]
pub struct SpacialEnsemble<T, R> { /* fields omitted */ }
Expand description
Implements a special Ensemble
- You can generate a dot file which includes special information.
- NOTE You should use neato for that to work
- see module for literature
Implementations
Generate a new Spacial ensemble with
n
nodesrng
as random number generatorf
- see paperalpha
- see paper
The specific model I implemented is described in
Timo Dewenter and Alexander K. Hartmann, “Large-deviation properties of resilience of power grids” New J. Phys. 17 (2015), DOI: 10.1088/1367-2630/17/1/015005
Euclidean distance between two vertices
- Calculates the distance between the vertices
corresponding to the indices
i
andj
None
if any of the indices is out of bounds
Calculates probability
- calculates the probability for an edge between the
vertices corresponding to the indices
i
andj
Of cause you can check if there is currently an edge, but this probability is the probability used when determining, if there should be an edge
Trait Implementations
Performs the conversion.
impl<'de, T, R> Deserialize<'de> for SpacialEnsemble<T, R> where
T: Deserialize<'de>,
R: Deserialize<'de>,
impl<'de, T, R> Deserialize<'de> for SpacialEnsemble<T, R> where
T: Deserialize<'de>,
R: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
You should use neato if you want the correct spacial placement of nodes
f
to create labels depending on the indexdot_options
use dot_options!
macro and take a look at module dot_constants
self.dot_from_indices
but returns String instead
self.dot_with_indices
but returns String instead
self.dot()
, but returns a String insteadimpl<T, R> MarkovChain<SpacialStep, SpacialStep> for SpacialEnsemble<T, R> where
T: Node,
R: Rng,
impl<T, R> MarkovChain<SpacialStep, SpacialStep> for SpacialEnsemble<T, R> where
T: Node,
R: Rng,
- panics if
step
is error, or cannot be undone The latter means, you are undoing the steps in the wrong order
Markov step Read more
Markov steps without return Read more
undo_steps
Accumulating markov step Read more
Accumulating markov steps Read more
Accumulating markov steps Read more
Undo markov steps Read more
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)
do the following times
times: Read more
Auto Trait Implementations
impl<T, R> RefUnwindSafe for SpacialEnsemble<T, R> where
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, R> Send for SpacialEnsemble<T, R> where
R: Send,
T: Send,
impl<T, R> Sync for SpacialEnsemble<T, R> where
R: Sync,
T: Sync,
impl<T, R> Unpin for SpacialEnsemble<T, R> where
R: Unpin,
T: Unpin,
impl<T, R> UnwindSafe for SpacialEnsemble<T, R> where
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more