Some systems might have an infinite number of states. Our traffic lights state machine is said to be finite because we have a finite number of states. In a state machine, the state can only change (and we have a transition) in response to an input. Some semaphores have a button that pedestrian can press to cause the red to display to cars, and that would be another input. The timer in this case is the input of the system. The traffic semaphore will change state when it receives an input, typically just a fixed timer that decides how much time the traffic lights should be green, yellow and red. In State Machines terminology, lights being on or off is called output.Įach of those 3 scenarios is called state. (Some semaphores are slightly different, but we don’t care for the sake of this example)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |