mTripleApl
Class DeliberativeAgent

java.lang.Object
  |
  +--mTripleApl.Agent
        |
        +--mTripleApl.DeliberativeAgent
All Implemented Interfaces:
java.lang.Runnable

public class DeliberativeAgent
extends Agent

Deliberative Agent implementation. This class implements a 3APL agent with the complete deliberative cycle.

Author:
Fernando Koch (fkoch@acm.org)

Field Summary
protected  java.util.Vector currentUtilities
           
protected  PlanRanker pranker
           
 
Fields inherited from class mTripleApl.Agent
bb, cb, completeCycle, currentGoal, currentGoalHistory, currentPlanBase, currentSuperPlan, fipaCommunication, gb, GC_AGGRESSIVE, GC_MEDIUM, GC_MODERATED, GC_NONE, gcLevel, isRunning, name, prb, stopRunning, VERSION
 
Constructor Summary
DeliberativeAgent(java.lang.String name)
          Create an Agent with a name.
 
Method Summary
 void deliberationReset()
          OVERLOADED.
 void externalAnalysis(java.util.Vector nextGoals)
          OVERLOAD.
 int getCost(java.lang.String actionStr)
          Get cost associated to an action.
 java.lang.String[] getCosts()
          Get list of actions with known costs.
 java.util.Vector getCurrentPlanBaseUtilities()
          Get current planBase utilities
 int getWorth(java.lang.String actionStr)
          Get worth associated to an action.
 java.lang.String[] getWorths()
          Get list of actions with known worths.
 void setCost(java.lang.String actionStr, int cost)
          Add cost for action.
 void setCurrentPlanBaseUtilities(java.util.Vector currentUtilities)
          Set current planBase utilities
 void setWorth(java.lang.String actionStr, int worth)
          Add worth for action.
 java.lang.String toString()
          OVERLOAD.
 
Methods inherited from class mTripleApl.Agent
addActuator, addBelief, addCapability, addGoal, addPlanRule, addProlog, addSensor, consult, consultProlog, deliberate, deliberationStep, destroy, executeCapability, executeSubPlan, getBeliefBase, getCapabilityBase, getCurrentGoal, getCurrentGoalHistory, getCurrentPlanBase, getGoalBase, getListOfActuators, getListOfSensors, getName, getPlanRuleBase, getStatistics, hasGoals, isRunning, isTraceEnabled, readSensor, receiveMessage, removeBelief, replyMessage, reset, run, sendMessage, setCompleteCycle, setFipaCommunication, setGCLevel, setTrace, setTrace, setTraceOutput, stop, traceOut, waitMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pranker

protected PlanRanker pranker

currentUtilities

protected java.util.Vector currentUtilities
Constructor Detail

DeliberativeAgent

public DeliberativeAgent(java.lang.String name)
Create an Agent with a name.

Parameters:
name - for this agent
Method Detail

getCurrentPlanBaseUtilities

public java.util.Vector getCurrentPlanBaseUtilities()
Get current planBase utilities

Returns:
current utilities

setCurrentPlanBaseUtilities

public void setCurrentPlanBaseUtilities(java.util.Vector currentUtilities)
Set current planBase utilities

Parameters:
currentUtilities - utilities to set

deliberationReset

public void deliberationReset()
OVERLOADED. Reset internal values and pass to super.

Overrides:
deliberationReset in class Agent

setCost

public void setCost(java.lang.String actionStr,
                    int cost)
Add cost for action.

Parameters:
actionStr - to parse and add
cost - assigned to action

getCost

public int getCost(java.lang.String actionStr)
Get cost associated to an action.

Parameters:
actionStr - to parse and add
Returns:
cost assigned to action

getCosts

public java.lang.String[] getCosts()
Get list of actions with known costs. Use with getCost(actionStr) to retrieve the associated cost.

Returns:
array of actions with known costs.

setWorth

public void setWorth(java.lang.String actionStr,
                     int worth)
Add worth for action.

Parameters:
actionStr - to parse and add
worth - assigned to action

getWorth

public int getWorth(java.lang.String actionStr)
Get worth associated to an action.

Parameters:
actionStr - to parse and add
Returns:
worth assigned to action

getWorths

public java.lang.String[] getWorths()
Get list of actions with known worths. Use with getWorth(actionStr) to retrieve the associated worth.

Returns:
array of actions with known worths.

externalAnalysis

public void externalAnalysis(java.util.Vector nextGoals)
OVERLOAD. Agent's externalAnalysis() method! Includes the Deliberative capability in the deliberation cycle!
 

WHAT-IS included?

(1) RANK THE PLANBASE per UTILITY

Overrides:
externalAnalysis in class Agent
Parameters:
nextGoals - list of next goals to this plan

toString

public java.lang.String toString()
OVERLOAD. Return String representation.

Overrides:
toString in class Agent
Returns:
String representation