Giter Club home page Giter Club logo

fsm-sim's Introduction

FSM-Sim

A simple Finite State Machine Simulation.

Moore Automata

Example 1:

CLI Command:

fsm -s "a,b,c,d" -l "0,1" -t "(a,0,a),(a,1,b),(b,0,a),(b,1,c),(c,0,a),(c,1,d),(d,0,a),(d,1,d)" -m "(a,0),(b,0),(c,0),(d,1)" -c "a" -i "0,1,0,1,0,1,1,1,1,0"

CLI Output:

Input:   0 1 0 1 0 1 1 1 1 0
States: a a b a b a b c d d a
Output: 0 0 0 0 0 0 0 0 1 1 0

Visualization Output:

Visualization Output

Example 2:

CLI Command:

fsm -s "a,b,c,d" -a -t "(a,0,a),(a,1,b),(b,0,a),(b,1,c),(c,0,a),(c,1,d),(d,0,a),(d,1,d)" -m "(a,0),(b,0),(c,0),(d,1)" -c "a" -i "0,1,0,1,0,1,1,1,1,0"

CLI Output:

Input:   0 1 0 1 0 1 1 1 1 0
States: a a b a b a b c d d a
Output: 0 0 0 0 0 0 0 0 1 1 0

Visualization Output:

Visualization Output

Mealy Automata

not yet implemented

CLI Flags

Use the flag -h to see the following output:

-a    sets the alphabet to {0,1} and visualizes the states mapped to 1 as double circles
-c string
    give a state of states as a starting point as a string
-i string
    give a series of letters as a string 0,1,0,1,1,...
-l string
    give all letters as a string like 0,1,...
-m string
    give a mapping for every state to a letter from the alphabet as a string like (a,0),...
-s string
    give all states as a string like a,b,c,...
-t string
    give all transitions as a string containing triples like (a,0,b),...

License

MIT

fsm-sim's People

Contributors

andreaswillibaldweber avatar

Stargazers

Ilnaz Tayebi avatar Jonas Wühr avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.