GithubHelp home page GithubHelp logo

umrsm-rs's Introduction

UMRSM-RS

A state machine framework inspired by the University of Michigan RoboSub State Machine framework in python, but written in rust (πŸš€πŸš€πŸš€πŸš€πŸš€πŸ”₯πŸ”₯πŸ”₯πŸš€πŸš€) for increased type safety (and performance I guess).

Each state in the state machine is represented by a type which implements State, which has three associated types, Income, Transition, and Data.

Data is the data type which is shared by all states in the state machine and which persists for the duration of the machine's operation.

Income is the data type which should be passed to the new state's init method on transition.

Transition is the data type which is output by the current state on each iteration of the state machine. Transition must implement IntoOutcome, which converts the transition type into a BoxedOutcome (Box<dyn Outcome>). Note that IntoOutcome is blanket implemented for all types which implement Outcome.

Outcomes determine the state which the state machine should transition to. If the state determined by Outcome is different to the current state of the state machine, then the Outcome must also provides the Income data for the new state. Should the data provided by Outcome not match the type of Income for the new state or if the type indicated by the Outcome is not present, the StateMachine's step function will return an error.

All state machines loop forever, reach a state which isn't in the state machine, transition to a state with the wrong income data, panic in some state's implemented method, or end with a transition to ().

Disclaimer: this project is not affiliated with The Rust Foundationβ„’ and does not claim to be in any form.

umrsm-rs's People

Contributors

rcoder01 avatar

Stargazers

Nolan Kuza 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.