statex v0.1.0 Statex.StateGraph View Source
module containing utility functions for dealing with stategraphs.
Stategraphs are a data structure based on elixir's keyword lists. The entire stategraph is a keyword list of all of the atoms representing state; the values are themselves keyword lists of transitions mapping back to state.
For example:
[state1: [flipflop: :state2],
state2: [flipflop: :state1]]
is a simple flip-flop state machine.
Link to this section Summary
Functions
returns the states from the state graph structure
returns all states from which there are no outward transitions
returns all of the transitions from the state graph structure
returns the successful state after transition, or an error tuple
Link to this section Types
Link to this section Functions
first_state(list) View Source
states(stategraph) View Source
returns the states from the state graph structure
terminal_states(stategraph) View Source
returns all states from which there are no outward transitions.
transitions(stategraph) View Source
returns all of the transitions from the state graph structure
validate_graph_structure!(state_graph) View Source
validate_node_transitions!(list, full_graph) View Source
validate_nodes!(list, full_graph) View Source
validate_transition(stategraph, start, transition) View Source
returns the successful state after transition, or an error tuple.