Class PlanningAgent

All Implemented Interfaces:
Direct Known Subclasses:

public class PlanningAgent
extends AbstractAgent

This class implements the agent loop for an agent which is capable of planning (but is not capable of interpretation of unexpected observations).

Planning is performed in an iterative fashion: first the agent looks for plans of length 0, then for plans of length 1, etc. The length of a plan is the number of time steps it consists of. The maximum allowed length of plans depends on parameter maxPlanLength in class PlanningAgentParams.

Fields inherited from class AbstractAgent
actions, aFiles, agentActions, currTime, dFiles, engine, exogenousActions, fluents, goals, history, tempFile
Fields inherited from class java.lang.Thread
Constructor Summary
          Constructs an instance of PlanningAgent.
Method Summary
 void agentLoop()
          The agent loop for the planning agent.
 ActionSequence findPlan(String goal)
          Computes a plan that achieves the given goal.
Methods inherited from class AbstractAgent
appendHistory, appendPlan, appendText, clearTempFile, computeAllTrajectories, computeOneTrajectory, findDefinedTrajectories, getAgentParams, getObservations, getObservations, getObservationsAndGoal, initialize, log, performPartOfPlan, repeatIteration, repeatIterationNoModel, repeatIterationNoPlan, run, showSelectedGoal, terminateLoop, terminateLoopNoModel, terminateLoopNoPlan, updateAgentFiles, updateGoals
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public PlanningAgent()
              throws Exception
Constructs an instance of PlanningAgent. (Invoked by APLAgent Manager)
Method Detail


public ActionSequence findPlan(String goal)
                        throws Exception
Computes a plan that achieves the given goal.

If no plan is found, repeatIterationNoPlan() is invoked to abort the method and repeat the current iteration of the agent loop.

goal - the goal that must be achieved
an ActionSequence describing the plan


public void agentLoop()
               throws Exception
The agent loop for the planning agent.
agentLoop in class AbstractAgent