Consider a subway turnstile.
1. Normal Logic:
The turnstile has only two states. It can
be locked, or it can be unlocked. When
the state machine diagram is first
activated, it will begin in the Locked
state. When a customer wants to pass
through the turnstile they must deposit a
coin. This causes the Coin event to occur. The Coin event, in the Locked state, causes the turnstile to transition to the Unlocked state, and causes the Unlock action to be invoked. Next the customer passes through the turnstile. This causes the Pass event to occur. The Pass event, in the Unlocked state, causes the turnstile to go back to the Locked state, and to invoke the Lock action.
- Draw state machine diagram that shows these two normal states.
2. Abnormal Logic:
What should we do if the turnstile is in the Locked state, but the user passes through anyway? Clearly we should add some kind of alarm. Note that the transition that handles this does not change the state. The turnstile remains in the Locked state. The other abnormal condition is when the turnstile is already unlocked and the customer deposits another coin. In this case, we light up a little “thank you” light.
- Show on the state machine diagram these two abnormal states.
3. Abnormal Logic with violation state:
if the turnstile is in the Locked state but the user passes through anyway, remaining in the Locked state is probably not the best approach for dealing with someone who has forced entry. Rather, we probably want to enter a Violation state. Moreover, we probably want to remain in that state until a repairman signals that the turnstile is ready for service.
- Show on the state machine diagram the violation state.
7 freelancere byder i gennemsnit $50 på dette job
Hi There I have checked your project description and understand everything. I am very confident that i can do this project perfectly. As i have 10+ years of experience in this field. thanks