Differences between revisions 15 and 16
Revision 15 as of 2011-09-11 12:03:49
Size: 2698
Editor: 87-198-113-42
Comment: Added python-fsm
Revision 16 as of 2011-11-06 16:27:46
Size: 3180
Editor: ppp121-44-194-137
Comment: Added fysom
Deletions are marked like this. Additions are marked like this.
Line 72: Line 72:

== fysom ==

A port of Jake Gordon's [[https://github.com/jakesgordon/javascript-state-machine|javascript-state-machine]]. The module lets the user define callbacks for before/after events as well as callbacks on entering/leaving states. Events are exposed as object methods which when called, causes the appropriate state transition. The module also provides asynchronous callback functionality which allows delaying a state transition.

[[https://github.com/oxplot/fysom]]

Introduction

This is a summary of FSM implementations in Python right now. Licensing remains unclear.

For general information about finite state machines, see:

Finite State Machine Editor

FSME is a tool where you can draw FSM diagrams, and then compile to a Python module (or C++ code.) It also makes an XML description of the FSM.

Requires QT for the editor. (Not the compiler, though, which probably reads XML.)

FSA - Finite State Automation in Python

FSA seems to be all about creating finite state machines, but I don't see a whole lot on how to use them.

Noah Spurrier's FSM

http://www.noah.org/python/FSM/

Noah's implementation is pure Python code. You init an FSM, register transitions, and then throw inputs at it. States and inputs must be hashable.

It's fairly similar to Skip's implementation (below).

fsmpy

fsmpy module

This seems to be a Python wrapper around AT&T's FSM library. It's all oriented around "weighted" finite state machines, so I'm not so sure how suitable it is if you just want to use unweighted FSM.

Decorator-based FSM

An example using decorators is in the Decorator Library on this site. The module simplifies implementation of FSM's based on UML 2.0 state diagrams. The FSM is implemented as a class, with methods of the class associated with transitions or with states. The design is not the best for constructing FSMs to parse text being somewhat slower than alternatives.

Skip Montanaro's FSM

fsm.py.

Features transition actions.

python-fsm FSM module with PyGraphViz support

An concise yet comprehensive implementation based on Wikipedia spec of Finite State Machines. The module can be used to build and further describe finite state automata with DOT graphs. It implements acceptors and transducers (Moore and Mealy machines) and provides an straight-forward way to inject and execute state change actions for entry, exit, input and transition.

Licensed under the new BSD license.

http://code.google.com/p/python-fsm/

fysom

A port of Jake Gordon's javascript-state-machine. The module lets the user define callbacks for before/after events as well as callbacks on entering/leaving states. Events are exposed as object methods which when called, causes the appropriate state transition. The module also provides asynchronous callback functionality which allows delaying a state transition.

https://github.com/oxplot/fysom

FiniteStateMachine (last edited 2014-09-06 09:12:52 by IoannisFilippidis)

Unable to edit the page? See the FrontPage for instructions.