hierarchical_state_machine 0.0.2 copy "hierarchical_state_machine: ^0.0.2" to clipboard
hierarchical_state_machine: ^0.0.2 copied to clipboard

A framework for building state machines similar to UML state charts. States are organized in parent/child relationships, allowing common event handling to be performed by more generic, containing states.

Hierarchical State Machine #

This hierarchial state machine (HSM) resembles a UML statechart, written in dart. States are oranized in parent/child relationships, allowing common event handling to be performed by more generic, containing states. This machine also supports parallel or "Orthogonal regions".

The most important information can be found in the EventHandler class:

/// Order of operations for the following state, assuming event T1 is fired and
/// s11 is the current state.
///     1) T1 delivered to s1
///     2) Guard g() is called. If it returns false, stop.
///     3) a(), b(), t(), c(), d(), e()
/// ┌──────────────────────────|s|──────────────────────────┐
/// │┌────|s1|────┐                    ┌────|s2|───────────┐│
/// ││exit:b()    │                    │entry:c()          ││
/// ││┌──|s11|──┐ │                    │-*:d()->┌──|s21|──┐││
/// │││exit:a() │ │--T1{guard:g(),     │        │entry:e()│││
/// │││         │ │      action:t()}-->│        │         │││
/// ││└─────────┘ │                    │        └─────────┘││
/// │└────────────┘                    └───────────────────┘│
/// └───────────────────────────────────────────────────────┘
7
likes
125
points
2.88k
downloads

Publisher

verified publishermcdole.org

Weekly Downloads

A framework for building state machines similar to UML state charts. States are organized in parent/child relationships, allowing common event handling to be performed by more generic, containing states.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

logging

More

Packages that depend on hierarchical_state_machine