-
-
Save jezinka/0dd35384253a523e0269eee4ec30a883 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static Map<State, List> state_machine_definition = [ | |
(State.ALIVE): [ | |
[event: Event.OVER_POPULATION, to: State.DEAD], | |
[event: Event.UNDER_POPULATION, to: State.DEAD], | |
[event: Event.STABLE, to: State.ALIVE, afterAction: 'increment'], | |
], | |
(State.DEAD) : [ | |
[event: Event.REPRODUCTION, to: State.ALIVE, afterAction: 'reset'], | |
[event: Event.STABLE, to: State.DEAD] | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment