3 ms·
What IS a state machine?
by piratebroadcast 13y ago
What IS a state machine?
- sologoub 13y ago"A finite-state machine (FSM) or finite-state automaton (plural: automata), or simply a state machine, is a mathematical model of computation used to design both computer programs and sequential logic circuits. It is conceived as an abstract machine that can be in one of a finite number of states. The machine is in only on one state at a time; the state it is in at any given time is called the current state. It can change from one state to another when initiated by a triggering event or condition; this is called a transition. A particular FSM is defined by a list of its states, and the triggering condition for each transition." Source: http://en.wikipedia.org/wiki/Finite-state_machine http://en.wikipedia.org/wiki/Finite-state_machine Basically, it's a way to track known "state" of a system and know valid and invalid (or prohibited) operations that can be performed and what "next" state these operations move the system to. For example, in a phone call, if the state is "ringing", your next options can be "answered", "no answer", "busy", or "failed" (including refusal to route, not in-service numbers, etc.). If you try to move the call into some other state, for example, "queued", a state machine should refuse to do so and respond with an error. A more complex example could be in managing conference rooms or call transfers.