// Data member inherited
// /*static*/ private Memory
currentKnowledge;
public Simple_Reflex_Agent
(ConditionActionTable c) {
currentKnowledge = c;
}
// Member methods inherited
//
// public abstract Percept
getPercept();
public Action getBestAction()
{
Condition currentCondition = Condition.interpretInput(currentPercept);
Rule matchedRule = currentKnowledge.ruleMatch(currentCondition);
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;
}
*/
}