com.irs.jam
Class Goal

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

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

Represents an agent's goals

See Also:
Serialized Form

Field Summary
protected  Relation _concludeRelation
           
protected  GoalAction _goalAction
           
protected  APLElement _intention
           
protected  IntentionStructure _intentionStructure
           
protected  int _newGoal
           
protected  Goal _prevGoal
           
protected  PlanRuntimeState _runtimeState
           
protected  int _status
           
protected  Goal _subgoal
           
 
Constructor Summary
Goal(GoalAction ga, Relation concludeRel, Goal prev, IntentionStructure is)
          Constructor with the goal specification, conclude relation, parent goal, and intention structure as parameters
 
Method Summary
 int clearNew()
           
 boolean confirmContext()
          Verify that the plan's context is valid.
 double evalUtility()
          This function should be defined in this goal class because it must use the binding of the subgoaling plan, not the candidate plans for this goal.
 int execute()
          Execute the procedure associated with a plan's BODY specification.
 int executeEffects()
          Execute the procedure associated with a plan's EFFECTS specification.
 int executeFailure()
          Execute the procedure associated with a plan's FAILURE specification.
 void format(java.io.PrintStream s)
          Format output to the given stream so that it can be in-line with other output.
 boolean generateAPL()
          Check whether the goal should have an Applicable Plan List created for it.
 Relation getConcludeRelation()
           
 GoalAction getGoalAction()
           
 Binding getGoalBinding()
          Get the binding of the goal arguments based upon the parent goal (if it exists).
 APLElement getIntention()
           
 Binding getIntentionBinding()
          Get the binding of the goal arguments based upon the plan's goal (if it exists).
 IntentionStructure getIntentionStructure()
          Return the agent's intention structure
 java.lang.String getName()
          Return the goal's relation label
 Goal getPrevGoal()
           
 Relation getRelation()
          Return the goal specification
 PlanRuntimeState getRuntimeState()
           
 int getStatus()
           
 Goal getSubgoal()
           
 boolean isLeafGoal()
           
 boolean isNew()
           
 boolean isStackBlocked()
          Check to see if the stack in which this goal is part is blocked.
 boolean isToplevelGoal()
           
 boolean isValid()
          Return whether the goal is still worth considering.
 boolean matchGoal(GoalAction goalAction, Binding goalActionBinding)
          Check whether the goal's specification compares to the parameters
 boolean matchRelation(Relation dstRelation, Binding dstBinding)
          Find matches between bound and unbound variables
 void print(java.io.PrintStream s)
          Format output to the given stream without considering having the output in-line with other output.
 void removeIntention(boolean failed)
          Remove the goal's intention and all subgoal intentions
 APLElement setIntention(APLElement se)
           
 int setNew()
           
 Goal setPrevGoal(Goal g)
           
 PlanRuntimeState setRuntimeState(PlanRuntimeState r)
           
 int setStatus(int st)
           
 Goal setSubgoal(Goal g)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_goalAction

protected GoalAction _goalAction

_concludeRelation

protected Relation _concludeRelation

_subgoal

protected Goal _subgoal

_prevGoal

protected Goal _prevGoal

_newGoal

protected int _newGoal

_status

protected int _status

_intention

protected APLElement _intention

_runtimeState

protected PlanRuntimeState _runtimeState

_intentionStructure

protected IntentionStructure _intentionStructure
Constructor Detail

Goal

public Goal(GoalAction ga,
            Relation concludeRel,
            Goal prev,
            IntentionStructure is)
Constructor with the goal specification, conclude relation, parent goal, and intention structure as parameters
Method Detail

isNew

public boolean isNew()

isToplevelGoal

public boolean isToplevelGoal()

isLeafGoal

public boolean isLeafGoal()

getGoalAction

public GoalAction getGoalAction()

getConcludeRelation

public Relation getConcludeRelation()

setNew

public int setNew()

clearNew

public int clearNew()

getSubgoal

public Goal getSubgoal()

setSubgoal

public Goal setSubgoal(Goal g)

getPrevGoal

public Goal getPrevGoal()

setPrevGoal

public Goal setPrevGoal(Goal g)

getIntention

public APLElement getIntention()

setIntention

public APLElement setIntention(APLElement se)

getStatus

public int getStatus()

setStatus

public int setStatus(int st)

getRuntimeState

public PlanRuntimeState getRuntimeState()

setRuntimeState

public PlanRuntimeState setRuntimeState(PlanRuntimeState r)

confirmContext

public boolean confirmContext()
Verify that the plan's context is valid.

execute

public int execute()
Execute the procedure associated with a plan's BODY specification.

executeFailure

public int executeFailure()
Execute the procedure associated with a plan's FAILURE specification.

executeEffects

public int executeEffects()
Execute the procedure associated with a plan's EFFECTS specification.

getName

public java.lang.String getName()
Return the goal's relation label

getRelation

public Relation getRelation()
Return the goal specification

generateAPL

public boolean generateAPL()
Check whether the goal should have an Applicable Plan List created for it.

getGoalBinding

public Binding getGoalBinding()
Get the binding of the goal arguments based upon the parent goal (if it exists).

getIntentionBinding

public Binding getIntentionBinding()
Get the binding of the goal arguments based upon the plan's goal (if it exists).

isValid

public boolean isValid()
Return whether the goal is still worth considering.

isStackBlocked

public boolean isStackBlocked()
Check to see if the stack in which this goal is part is blocked.

evalUtility

public double evalUtility()
This function should be defined in this goal class because it must use the binding of the subgoaling plan, not the candidate plans for this goal.

matchRelation

public boolean matchRelation(Relation dstRelation,
                             Binding dstBinding)
Find matches between bound and unbound variables

matchGoal

public boolean matchGoal(GoalAction goalAction,
                         Binding goalActionBinding)
Check whether the goal's specification compares to the parameters

getIntentionStructure

public IntentionStructure getIntentionStructure()
Return the agent's intention structure

removeIntention

public void removeIntention(boolean failed)
Remove the goal's intention and all subgoal intentions

print

public void print(java.io.PrintStream s)
Format output to the given stream without considering having the output in-line with other output.

format

public void format(java.io.PrintStream s)
Format output to the given stream so that it can be in-line with other output.