Enum net_ensembles::ConfigurationModelStep [−][src]
Expand description
Markov step of configuration model
Variants
step did not succeed
- Step did succeed and can be undone using this
- contains the newly added edges, which is enough information to know which edges were removed
Trait Implementations
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
impl<T, R> MarkovChain<ConfigurationModelStep, Result<(), UndoStepErrorCM>> for ConfigurationModel<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> MarkovChain<ConfigurationModelStep, Result<(), UndoStepErrorCM>> for ConfigurationModel<T, R> where
T: Node + SerdeStateConform,
R: Rng,
Markov step
- use this to perform a markov step, e.g., to create a markov chain
- result
ConfigurationModelStep
can be used to undo the step withself.undo_step(result)
How it works
- it draws two distinct vertices, weighted with the Vertex degree
- then for each vertex a random edge is drawn from the respective adjacency list. let these edges be edge1 = (n, j) and edge2 = (k, l). These edges are removed and the edges (n, k) and (j, l) are added.
- If the above would result in an invalid topology,
nothing is added or removed and
ConfigurationModelStep::Error
is returned
Undo a markcov step
- adds removed edge and removes added edge, or does nothing
Important:
Restored graph is the same as before the random step except the order of nodes in the adjacency list might be shuffled!
Error
If an error is encountered, this will revert the graph to the state, before trying to undo the step. The returned Error gives a hint for why this did not succeed.
Undo a markcov step
- adds removed edge and removes added edge, or does nothing
- as long as you know, that you undo the steps in the correct order, this is the prefered method as this more efficent
- panics if an Error is encountered
Markov steps without return Read more
Accumulating markov step Read more
Accumulating markov steps Read more
Accumulating markov steps Read more
Undo markov steps Read more
Auto Trait Implementations
impl RefUnwindSafe for ConfigurationModelStep
impl Send for ConfigurationModelStep
impl Sync for ConfigurationModelStep
impl Unpin for ConfigurationModelStep
impl UnwindSafe for ConfigurationModelStep
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