-
-
Notifications
You must be signed in to change notification settings - Fork 2
Convention Guide
Fahmi Akbar Wildana edited this page Jun 10, 2019
·
13 revisions
When designing a State Machine, you need to know the purpose. Each State Machine has a slightly different convention.
- When the element name of the State Machine similar to each other:
- Rename the state as past or continuous tense when it has the same name as the event. However, try to avoid this because not all world languages have a past or continuous tense verb
- For the event name, the name must answer this question:
- What is the event? (Answer: pay)
- How to trigger it? (Answer: by clicking the button or hit the enter key)
- Use Protocol Transition when you want to explain the lifecycle of some states
- Use guards as a weight when designing UI that adapts to data. In other word, mix it with weighted graphs.
- Always think about how the system can recover from failure
- Usually, they use self (loop) and backward transition to recover from failure
- Use Protocol Transition when you want explain lifecycle of some processes
- Use guards when you want to make adaptive processes
- for deterministic A.I, use Behaviour Tree (HSFM vs Behaviour Tree) or
- shape it as an acyclic graph (no self or backward transition)
- use guards when designing probabilistic A.I (weighted graph)
- utilize State Management library or
- rely heavily on invoking/spawning services, calling actions, and assigning a context