public class ReflexVacuumAgent extends AbstractAgent
function REFLEX-VACUUM-AGENT([location, status]) returns an action if status = Dirty then return Suck else if location = A then return Right else if location = B then return LeftFigure 2.8 The agent program for a simple reflex agent in the two-state vacuum environment. This program implements the action function tabulated in Figure 2.3.
program| Constructor and Description |
|---|
ReflexVacuumAgent() |
execute, isAlive, setAlive