[−][src]Trait stateright::StateMachine
Defines how a state begins and evolves, possibly nondeterministically.
Associated Types
type State
The type of state upon which this machine operates.
type Action
The type of action that transitions between states.
Required methods
fn init_states(&self) -> Vec<Self::State>
Returns the initial possible states.
fn actions(&self, state: &Self::State, actions: &mut Vec<Self::Action>)
Collects the subsequent possible actions based on a previous state.
fn next_state(
&self,
last_state: &Self::State,
action: &Self::Action
) -> Option<Self::State>
&self,
last_state: &Self::State,
action: &Self::Action
) -> Option<Self::State>
Converts a previous state and action to a resulting state. None
indicates that the action
does not change the state.
Provided methods
fn display_outcome(
&self,
last_state: &Self::State,
action: &Self::Action
) -> Option<String> where
Self::State: Debug,
&self,
last_state: &Self::State,
action: &Self::Action
) -> Option<String> where
Self::State: Debug,
Summarizes the outcome of taking a step.
fn next_steps(
&self,
last_state: &Self::State
) -> Vec<(Self::Action, Self::State)> where
Self::State: Hash,
&self,
last_state: &Self::State
) -> Vec<(Self::Action, Self::State)> where
Self::State: Hash,
Indicates the steps (action-state pairs) that follow a particular state.
fn next_states(&self, last_state: &Self::State) -> Vec<Self::State>
Indicates the states that follow a particular state. Slightly more efficient than calling
next_steps
and projecting out the states.
fn follow_fingerprints(
&self,
init_states: Vec<Self::State>,
fingerprints: Vec<Fingerprint>
) -> Option<Self::State> where
Self::State: Hash,
&self,
init_states: Vec<Self::State>,
fingerprints: Vec<Fingerprint>
) -> Option<Self::State> where
Self::State: Hash,
Determines the final state associated with a particular fingerprint path.
Implementors
impl<A: Actor<ModelId>> StateMachine for ActorSystem<A> where
A::Msg: Clone + Debug + Ord,
A::State: Clone + Debug + Eq,
[src]
A::Msg: Clone + Debug + Ord,
A::State: Clone + Debug + Eq,
type State = ActorSystemSnapshot<A::Msg, A::State>
type Action = ActorSystemAction<A::Msg>
fn init_states(&self) -> Vec<Self::State>
[src]
fn actions(&self, state: &Self::State, actions: &mut Vec<Self::Action>)
[src]
fn next_state(
&self,
last_state: &Self::State,
action: &Self::Action
) -> Option<Self::State>
[src]
&self,
last_state: &Self::State,
action: &Self::Action
) -> Option<Self::State>
fn display_outcome(
&self,
last_state: &Self::State,
action: &Self::Action
) -> Option<String> where
Self::State: Debug,
[src]
&self,
last_state: &Self::State,
action: &Self::Action
) -> Option<String> where
Self::State: Debug,