A state machine that transitions through a set number of discrete (finite) states.  When specified conditions are met, this transition occurs, and certain tasks are performed.  The code should be implemented for an autonomously operating machine.