A finite state machine that will work with any provided by you states as long as you will describe a JSON file with states presented in a right format.
This app uses the Gradle build system.
- To build a project, enter the project directory and use the
./gradlew buildcommand or use "Import Project" in Android Studio. - Use
./gradlew testto run the unit test on your local host.
The JSON file must have an array of states. Each state is presented as:
{
"name": "AlarmDisarmed_AllUnlocked",
"transition":
[
{"action": "LOCK", "next_state": "AlarmDisarmed_AllLocked"},
{"action": "LOCKx2", "next_state": "AlarmArmed_AllLocked"},
{"action": "UNLOCK", "next_state": "AlarmDisarmed_AllUnlocked"},
{"action": "UNLOCKx2", "next_state": "AlarmDisarmed_AllUnlocked"}
]
},It has a name, and array of transitions. Transitions contain an action and a next state.
Also there has to be an initial state. The state from which the machine starts. It is described like this:
{
"initial_state" : "AlarmDisarmed_AllUnlocked"
},It has only a name. So, if you want to use the FiniteStateMachine class for your automaton, you should replace default values with yours.
Lets see the relations between classes and packages



