Class DiagnosticAgent

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--AbstractAgent
              |
              +--PlanningAgent
                    |
                    +--DiagnosticAgent
All Implemented Interfaces:
Runnable

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
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DiagnosticAgent()
          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
findPlan
 
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

DiagnosticAgent

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

testFluent

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

explainObservations

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.


agentLoop

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