Jump to content

Event-driven finite-state machine

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Linas (talk | contribs) at 21:42, 29 May 2007 (rm the bias thing. Also, the cut text was moved to talk page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computation, a finite state machine (FSM) is event-driven if the creator of the FSM intends to think of the machine as consuming events or messages. This is in contrast to the parsing-theory origins of the term finite-state machine where the machine is described as consuming characters or tokens.

Often these machines are implemented as threads or processes communicating with one another as part of a larger application. For example, an individual car in a traffic simulation might be implemented as an event-driven finite-state machine.

This is a common and useful idiom, though not as precisely defined and theoretically-grounded as the application of finite state machines to parsing. By abuse of terminology, programmers may refer to code created while thinking of this idiom as a finite state machine even if the space required for the state grows with the size of the input.