[−][src]Enum net_ensembles::sw::SwChangeState
Returned by markov steps
- information about the performed step and possible errors
Variants
ERROR adjecency list invalid?
Can not add edge twice
Nothing happend
old edge: (Rewire.0, Rewire.1), new edge (Rewire.0, Rewire.2)
old edge: (Reset.0, Reset.1), new edge (Reset.0, Reset.2)
GError(GraphErrors)
A GraphError occurred
Implementations
impl SwChangeState
[src]
pub fn is_nothing(&self) -> bool
[src]
checks if self is Nothing
variant
pub fn is_nothing_or_blocked(&self) -> bool
[src]
checks if self is Nothing
or BlockedByExistingEdge
pub fn not_nothing_or_blocked(&self) -> bool
[src]
result is equal to !self.is_nothing_or_blocked()
pub fn is_valid(&self) -> bool
[src]
valid states:
SwChangeState::Rewire(..)
SwChangeState::Reset(..)
SwChangeState::Nothing
SwChangeState::BlockedByExistingEdge
invalid states:
SwChangeState::InvalidAdjecency
SwChangeState::GError(..)
Trait Implementations
impl Debug for SwChangeState
[src]
impl<T, R> MarkovChain<SwChangeState, SwChangeState> for SwEnsemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
[src]
T: Node + SerdeStateConform,
R: Rng,
fn m_step(&mut self) -> SwChangeState
[src]
Markov step
- use this to perform a markov step
- keep in mind, that it is not unlikely for a step to do
Nothing
as it works by drawing an edge and then reseting it withr_prob
, else the edge is rewired - result
SwChangeState
can be used to undo the step withself.undo_step(result)
- result should never be
InvalidAdjecency
orGError
if used on a valid graph
fn undo_step(&mut self, step: SwChangeState) -> SwChangeState
[src]
Undo a markov step
- rewires edge to old state
- Note: cannot undo
InvalidAdjecency
orGError
, will just returnInvalidAdjecency
orGError
respectively - returns result of rewire
Important:
Restored graph is the same as before the random step except the order of nodes in the adjacency list might be shuffled!
fn undo_step_quiet(&mut self, step: SwChangeState)
[src]
Undo a Monte Carlo step
- rewires edge to old state
- panics if you try to undo
InvalidAdjecency
orGError
- panics if rewire result (
SwChangeState
) is invalid (i.e.!result.is_valid()
)
Important:
Restored graph is the same as before the random step except the order of nodes in the adjacency list might be shuffled!
fn m_steps(&mut self, count: usize) -> Vec<S>
[src]
fn undo_steps(&mut self, steps: Vec<S>) -> Vec<Res>
[src]
fn undo_steps_quiet(&mut self, steps: Vec<S>)
[src]
Auto Trait Implementations
impl RefUnwindSafe for SwChangeState
impl Send for SwChangeState
impl Sync for SwChangeState
impl Unpin for SwChangeState
impl UnwindSafe for SwChangeState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,