All Projects β†’ leonardomso β†’ Awesome Fsm

leonardomso / Awesome Fsm

Licence: mit
πŸ€– A curated list of awesome resources related to finite state machines and statecharts.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Awesome Fsm

Django Fsm
Django friendly finite state machine support
Stars: ✭ 1,898 (+904.23%)
Mutual labels:  state-machine, finite-state-machine
Xstateful
A wrapper for xstate that stores state, handles transitions, emits events for state changes and actions/activities, and includes an optional reducer framework for updating state and invoking side-effects
Stars: ✭ 81 (-57.14%)
Mutual labels:  state-machine, finite-state-machine
Statecharts.github.io
There is no state but what we make. Feel free to pitch in.
Stars: ✭ 265 (+40.21%)
Mutual labels:  state-machine, finite-state-machine
Easy States
The simple, stupid state machine for Java
Stars: ✭ 167 (-11.64%)
Mutual labels:  state-machine, finite-state-machine
Nanostate
🚦- Small Finite State Machines
Stars: ✭ 151 (-20.11%)
Mutual labels:  state-machine, finite-state-machine
SimpleStateMachineLibrary
πŸ“š A simple library for realization state machines in C# code
Stars: ✭ 30 (-84.13%)
Mutual labels:  state-machine, finite-state-machine
Hal
πŸ”΄ A non-deterministic finite-state machine for Android & JVM that won't let you down
Stars: ✭ 63 (-66.67%)
Mutual labels:  state-machine, finite-state-machine
pastafarian
A tiny event-based finite state machine
Stars: ✭ 20 (-89.42%)
Mutual labels:  state-machine, finite-state-machine
Hsm
Finite state machine library based on the boost hana meta programming library. It follows the principles of the boost msm and boost sml libraries, but tries to reduce own complex meta programming code to a minimum.
Stars: ✭ 106 (-43.92%)
Mutual labels:  state-machine, finite-state-machine
Finity
A finite state machine library for Node.js and the browser with a friendly configuration DSL.
Stars: ✭ 88 (-53.44%)
Mutual labels:  state-machine, finite-state-machine
statemachine-go
🚦 Declarative Finite-State Machines in Go
Stars: ✭ 47 (-75.13%)
Mutual labels:  state-machine, finite-state-machine
Python Statemachine
Python Finite State Machines made easy.
Stars: ✭ 184 (-2.65%)
Mutual labels:  state-machine, finite-state-machine
UnityHFSM
A simple yet powerful class based hierarchical finite state machine for Unity3D
Stars: ✭ 243 (+28.57%)
Mutual labels:  state-machine, finite-state-machine
use-tiny-state-machine
A tiny (~700 bytes) react hook to help you write finite state machines
Stars: ✭ 37 (-80.42%)
Mutual labels:  state-machine, finite-state-machine
simple-state-machine
A simple Java state machine for Spring Boot projects
Stars: ✭ 25 (-86.77%)
Mutual labels:  state-machine, finite-state-machine
Fsm As Promised
A finite state machine library using ES6 promises
Stars: ✭ 446 (+135.98%)
Mutual labels:  state-machine, finite-state-machine
xstate
State machines and statecharts for the modern web.
Stars: ✭ 21,286 (+11162.43%)
Mutual labels:  state-machine, finite-state-machine
use-state-machine
Use Finite State Machines with React Hooks
Stars: ✭ 28 (-85.19%)
Mutual labels:  state-machine, finite-state-machine
Jstate
Advanced state machines in Java.
Stars: ✭ 84 (-55.56%)
Mutual labels:  state-machine, finite-state-machine
Afsm
C++14 Finite State Machine library
Stars: ✭ 113 (-40.21%)
Mutual labels:  state-machine, finite-state-machine


logo of awesome-fsm repository

Awesome Finite State Machines

A curated list of awesome resources related to finite state machines and statecharts.

The main idea of this repository is to have a nice place when people can rely on nice quality content, such as articles, videos, ebooks, documents, books, etc. A little different from the other awesome type lists that we can find in GitHub about a variety of topics, the idea of this list is to provide a nice and short explanation about concepts first, then show a list of nice content related to that specific concept.

Any comments or suggestions about nice quality content that should be in this repository, please open an issue.

Contents

Introduction

You might have not heard the term "finite state machines" before, but humanity has been using this concept every day for a long time. Not only in the programming world, but in real life too, we have a lot of systems that rely upon the concept of finite state machines.

Finite state machines are a computation model, it consists of a machine with a finite number of states. A finite state machine has a finite number of events, to move from one state to another we have something called transitions. These transitions are triggered after a specific event, each transition expects an input, after its triggered, it will change to a specific state depending on the current state and the event.

We can simplify a finite state machine in 4 parts:

  1. A finite number of states.
  2. A finite number of events.
  3. An initial state.
  4. A transition will be triggered after a specific event and will change to a specific state depending on the current state and the event.

Finite state machines can be used to simulate sequential logic, let's take as an example of a traffic light.

We know that a traffic light has only 3 possible states: green, yellow, and red. To change from one state to another, we will use it as an input integer representing seconds. When the input is 60, the machine will trigger an event and transition to another state depending on the current state and the event, in our case, the seconds.

traffic light finite state machine example

We can observe finite state machines not only inside the software development but in our real world as well. You can think about almost anything and use finite state machines for it. By having a finite number of states, it reduces drastically the possibility of having unexpected side-effects in your application, your application will get more consistent, well-written, and maintainable.

Further Reading

Concepts

In the finite state machine model, we have a few different concepts that it’s very important to learn about. There are two types of finite state machines: deterministic state automaton and non-deterministic state automaton. There are a few differences between those two types.

A deterministic state automaton is a finite state machine with a finite number of states and input symbols. A transition is defined in every state for every input symbol. Each input symbol will determine which state the machine will move. A deterministic finite automaton machine can only be in one state at a time, and transition to one state at a time.

A non-deterministic finite automaton has a finite number of states and a finite number of input symbols. In a nondeterministic finite automaton, for each state and input symbol, it can be one or more output states. NFAs can be in one or more states at once.

If you’re wondering, an automaton is the plural of automata. Finite state machines are also known as finite-state automata or finite-state automaton.

Deterministic Finite Automaton (DFAs)

A deterministic finite automaton finite state machine with a finite number of inputs symbols. For each input symbol, it will determine which state the machine will move. A deterministic finite automaton machine can only be in one state at a time, and transition to one state at a time.

Further Reading

Non-deterministic Finite Automaton (NFAs)

A nondeterministic finite automaton has a finite number of states and a finite number of input symbols. In a nondeterministic finite automaton, for each state and input symbol, it can be one or more output states. NFAs can be in one or more states at once.

Further Reading

Mealy Machine

A mealy machine is a machine where the output value is determined by the input and the current state. For each input and state in a Mealy machine, one transition is possible.

Further Reading

Moore Machine

A Moore machine is a machine where the output is determined by only its current state. The output depends only on the present state and it's the same output every time the machine enters that state.

Further Reading

Statecharts

Sometimes we need something more sophisticated and complex, and that's when a finite state machine cannot help us.

Statecharts are an extension of traditional finite state machines, the main difference of statecharts is that it can have a hierarchical state, states can contain nested state inside them. The reason for this is simple, not all applications in the world can be described as flat multi numbers of states, sometimes we need to have nested states.

Statecharts also bring us a few extra features such as actions, entry and exit actions, guard conditions, deferred events, etc.

Further Reading

Libraries

JavaScript

Java

Python

Ruby

Go

Shell

C++

Contributing

Your contributions are welcome! If you have any content that can contribute to our list, please open a PR.


If there are any questions about this list or about any other topic, please contact me on Twitter @leonardomso and I'll gladly answer it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].