com.irs.jam
Class IntentionStructure

java.lang.Object
  |
  +--com.irs.jam.IntentionStructure
All Implemented Interfaces:
java.io.Serializable

public class IntentionStructure
extends java.lang.Object
implements java.io.Serializable

Represents the agent's intentions

See Also:
Serialized Form

Field Summary
protected  Goal _currentGoal
           
protected  Interpreter _interpreter
           
protected  DList _stacks
           
static int IS_ABANDONED
           
static int IS_ACTIVE
           
static int IS_BLOCKED
           
static int IS_FAILURE
           
static int IS_SUCCESS
           
static int IS_UNTRIED
           
 
Constructor Summary
IntentionStructure(Interpreter interpreter)
          Default constructor w/ parent interpreter
 
Method Summary
 Goal addUnique(GoalAction goalAction, Relation concludeRel, Goal prevGoal, Binding b)
          Add the specified goal to the intention structure only if it doesn't already exist.
 boolean allGoalsDone()
          Old GoalList functionality
 void drop(GoalAction goalAction, Binding b)
          Find and remove a goal from the Intention Structure
 int executePlan(Plan plan)
          Perform an agent's plan
 Goal getCurrentGoal()
           
 Interpreter getInterpreter()
           
 DList getStacks()
           
 DList getToplevelGoals()
           
 APLElement intend(APLElement intention, boolean force)
          Add an intention to the agent's list of intentions
 void print(java.io.PrintStream s)
          Output information about the Intention Structure in a readable format.
 void refreshUtilities()
          Go through all of the stacks and recompute their utility values
 void removeGoal(Goal goal)
          Remove the indicated goal by searching through each intention stack and going through each from top to bottom.
 void renewLeafGoals()
          Go through all of the stacks and mark all inactive goals as being "new" in order to trigger APL generation.
 void sortStacksByUtility()
          Arrange the intention stacks according to their evaluated utilities.
 int think()
          Execute the highest-utility intention
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IS_UNTRIED

public static final int IS_UNTRIED

IS_FAILURE

public static final int IS_FAILURE

IS_SUCCESS

public static final int IS_SUCCESS

IS_ACTIVE

public static final int IS_ACTIVE

IS_BLOCKED

public static final int IS_BLOCKED

IS_ABANDONED

public static final int IS_ABANDONED

_stacks

protected DList _stacks

_currentGoal

protected Goal _currentGoal

_interpreter

protected Interpreter _interpreter
Constructor Detail

IntentionStructure

public IntentionStructure(Interpreter interpreter)
Default constructor w/ parent interpreter
Method Detail

getStacks

public DList getStacks()

getToplevelGoals

public DList getToplevelGoals()

getCurrentGoal

public Goal getCurrentGoal()

getInterpreter

public Interpreter getInterpreter()

sortStacksByUtility

public void sortStacksByUtility()
Arrange the intention stacks according to their evaluated utilities. [This seems like it doesn't use the leaf-level utilities, which would be incorrect. Need to verify this.]

intend

public APLElement intend(APLElement intention,
                         boolean force)
Add an intention to the agent's list of intentions
Parameters:
intention - The instantiated plan to be intended
force - Whether to consider utilities or just put onto intention structure

think

public int think()
Execute the highest-utility intention

executePlan

public int executePlan(Plan plan)
Perform an agent's plan

refreshUtilities

public void refreshUtilities()
Go through all of the stacks and recompute their utility values

renewLeafGoals

public void renewLeafGoals()
Go through all of the stacks and mark all inactive goals as being "new" in order to trigger APL generation.

allGoalsDone

public boolean allGoalsDone()
Old GoalList functionality

drop

public void drop(GoalAction goalAction,
                 Binding b)
Find and remove a goal from the Intention Structure

addUnique

public Goal addUnique(GoalAction goalAction,
                      Relation concludeRel,
                      Goal prevGoal,
                      Binding b)
Add the specified goal to the intention structure only if it doesn't already exist.

removeGoal

public void removeGoal(Goal goal)
Remove the indicated goal by searching through each intention stack and going through each from top to bottom.

print

public void print(java.io.PrintStream s)
Output information about the Intention Structure in a readable format.