class documentation

class MethodicalMachine(object): (source)

View In Hierarchy

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 asDigraph 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 _oneTransition See MethodicalState.upon.
Instance Variable _automaton Undocumented
Instance Variable _reducers Undocumented
Instance Variable _symbol Undocumented
Property _setTrace Undocumented
def __get__(self, oself, type=None): (source)

MethodicalMachine is an implementation detail for setting up class-level state; applications should never need to access it on an instance.

def __init__(self): (source)

Undocumented

def asDigraph(self): (source)

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
@_keywords_only
def input(self): (source)

Declare an input.

This is a decorator for methods.

@_keywords_only
def output(self): (source)

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 serializer(self): (source)

Undocumented

@_keywords_only
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:boolis this state the initial state? Only one state on this automat.MethodicalMachine may be an initial state; more than one is an error.
terminal:boolIs this state a terminal state? i.e. a state that the machine can end up in? (This is purely informational at this point.)
serialized:Hashablea serializable value to be used to represent this state to external systems. This value should be hashable; str is a good type to use.
@_keywords_only
def unserializer(self): (source)

Undocumented

def _oneTransition(self, startState, inputToken, endState, outputTokens, collector): (source)
_automaton = (source)

Undocumented

_reducers: dict = (source)

Undocumented

Undocumented

@property
_setTrace: MethodicalTracer = (source)

Undocumented