// Data member inherited
// /*static*/ private Memory
currentKnowledge;
public Simple_Reflex_Agent_with_State
(Condition_Action_Table_with_State c) {
currentKnowledge = c;
}
// Member methods inherited
//
// public abstract Percept
getPercept();
public Action getBestAction()
{
Rule matchedRule =
currentKnowledge.ruleMatch(currentKnowledge.getState());
Action bestAction = matchedRule.fetchAction();
return bestAction;
}
// Inherited
/*
public Action recommendAction () {
Percept currentPercept; Action actionToTake;
// Get the new percept
currentPercept = getPercept();
// Update the knowledge by the new percept
currentKnowledge.update(currentPercept);
// Choose the best action based on the current knowledge
actionToTake = getBestAction();
// Update the knowledge by the effects of action to be taken
currentKnowledge.update(currentKnowledge, actionToTake);
// Return action to be taken
return actionToTake;
}
*/
}