public abstract class Generic_Agent { // Data members /*static*/ private Memory currentKnowledge; // Member methods // public abstract Percept getPercept(); public abstract Action getBestAction(); 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(actionToTake); // Return action to be taken return actionToTake; } }