Class DiagnosticAgent

All Implemented Interfaces:

public class DiagnosticAgent
extends PlanningAgent

This class implements the agent loop for an agent which is capable of planning and 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.

Observations are interpreted by generating explanations (i.e., unobserved occurrences of exogenous actions) that justify them.

This class uses the same parameters as the PlanningAgent class.

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 DiagnosticAgent.
Method Summary
 void agentLoop()
          The agent loop for the diagnostic agent.
 void explainObservations()
          Checks whether the observations are unexpected.
 boolean testFluent(String fluent)
          Displays a dialog asking the user if the given fluent is true or false.
Methods inherited from class PlanningAgent
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 DiagnosticAgent()
                throws Exception
Constructs an instance of DiagnosticAgent. (Invoked by APLAgent Manager)
Method Detail


public boolean testFluent(String fluent)
Displays a dialog asking the user if the given fluent is true or false.
fluent - the name of the fluent
the observer truth value


public void explainObservations()
                         throws Exception
Checks whether the observations are unexpected. If they are:
(1) generates explanations for them;
(2) poses questions to find which is a diagnosis;
(3) updates the history accordingly.


public void agentLoop()
               throws Exception
The agent loop for the diagnostic agent.
agentLoop in class PlanningAgent