public class TableDrivenAgentProgram extends java.lang.Object implements AgentProgram
function TABLE-DRIVEN-AGENT(percept) returns an action
persistent: percepts, a sequence, initially empty
table, a table of actions, indexed by percept sequences, initially fully specified
append percept to end of percepts
action <- LOOKUP(percepts, table)
return action
Figure 2.7 The TABLE-DRIVEN-AGENT program is invoked for each new percept and
returns an action each time. It retains the complete percept sequence in
memory.| Constructor and Description |
|---|
TableDrivenAgentProgram(java.util.Map<java.util.List<Percept>,Action> perceptSequenceActions)
Constructs a TableDrivenAgentProgram with a table of actions, indexed by
percept sequences.
|
| Modifier and Type | Method and Description |
|---|---|
Action |
execute(Percept percept)
The Agent's program, which maps any given percept sequences to an action.
|
public TableDrivenAgentProgram(java.util.Map<java.util.List<Percept>,Action> perceptSequenceActions)
perceptSequenceActions - a table of actions, indexed by percept sequencespublic Action execute(Percept percept)
AgentProgramexecute in interface AgentProgrampercept - The current percept of a sequence perceived by the Agent.