class documentation
class MethodicalMachine(object): (source)
A MethodicalMachine
is an interface to an Automaton
that uses methods on a class.
Method | __get__ |
MethodicalMachine is an implementation detail for setting up class-level state; applications should never need to access it on an instance. |
Method | __init__ |
Undocumented |
Method | as |
Generate a graphviz.Digraph that represents this machine's states and transitions. |
Method | input |
Declare an input. |
Method | output |
Declare an output. |
Method | serializer |
Undocumented |
Method | state |
Declare a state, possibly an initial state or a terminal state. |
Method | unserializer |
Undocumented |
Method | _one |
See MethodicalState.upon . |
Instance Variable | _automaton |
Undocumented |
Instance Variable | _reducers |
Undocumented |
Instance Variable | _symbol |
Undocumented |
Property | _set |
Undocumented |
MethodicalMachine
is an implementation detail for setting up class-level state; applications should never need to access it on an instance.
Generate a graphviz.Digraph
that represents this machine's states and transitions.
Returns | |
graphviz.Digraph object; for more information, please see the documentation for graphviz |
Declare an output.
This is a decorator for methods.
This method will be called when the state machine transitions to this state as specified in the decorated `output` method.
@_keywords_only
def state(self, initial:
def state(self, initial:
bool
= False, terminal: bool
= False, serialized: Hashable
= None):
(source)
¶
Declare a state, possibly an initial state or a terminal state.
This is a decorator for methods, but it will modify the method so as not to be callable any more.
Parameters | |
initial:bool | is this state the initial state? Only one state on this automat.MethodicalMachine may be an initial state; more than one is an error. |
terminal:bool | Is this state a terminal state? i.e. a state that the machine can end up in? (This is purely informational at this point.) |
serialized:Hashable | a serializable value to be used to represent this state to external systems. This value should be hashable; str is a good type to use. |