mil.navy.nps.relate
Interface Goal

All Known Implementing Classes:
GoalCoordinate, GoalDefensive, GoalOffensive

public interface Goal

This interface implements the RELATE Goal.

Defines the minimum requirements for a RELATE Goal. Provides a mechanism to select from a collection of methods (rules) that affect an Agent's internal state or it's environment. These methods are selected based on the activeRule of a collection of Rules. The method, or action, taken is intended to satisfy the Goal. A feedback mechanism is provided in the assignCredit method to determine the health of the Goal as well as the current active Rule.

Since:
JDK1.3
Version:
1.0, 17 Aug 00
Author:
Michael R. Dickson, Kimberly A. Roddy

Method Summary
 void addRule(Rule pRule)
          Adds the passed in Rule to the ruleList Vector.
 void assignCredit(SensedEnvironment pPE)
          Assigns credit to itself (i.e.
 Rule getActiveRule()
          Gets the Goal active rule
 java.lang.String getGoalName()
          Gets the Goal name
 int getGoalType()
          Gets the Goal type
 Rule getPastActiveRule()
          Gets the Goal past active rule
 java.util.Vector getRuleList()
          Returns the ruleList Vector.
 boolean removeRule(Rule pRule)
          Removes the Rule from the ruleList Vector.
 java.lang.Object runActiveRule(SensedEnvironment pPE)
          Passes the PerceivedEnvironment to the activeRule in its calculate() method.
 void setActiveRule(Rule pRule)
          Sets the ActiveRule, used for goal attainment.
 void setGoalType(int pType)
          Sets the Goals type, the developer should designate specific goal types to be used in the RELATE architecture.
 void setPastActiveRule(Rule pRule)
          Sets the PastActiveRule, used for comparison and rule weight calculation
 java.lang.String toString()
          Returns a formated description of this Goal suitable for printing
 

Method Detail

addRule

public void addRule(Rule pRule)
Adds the passed in Rule to the ruleList Vector.


removeRule

public boolean removeRule(Rule pRule)
Removes the Rule from the ruleList Vector.

Parameters:
pRule - The Rule that is to be removed
Returns:
The success of the removal operation:
  • true - The Rule was successfully removed
  • false - The Rule did not exist in the Goal's ruleList

  • getRuleList

    public java.util.Vector getRuleList()
    Returns the ruleList Vector.

    Returns:
    ruleList

    assignCredit

    public void assignCredit(SensedEnvironment pPE)
    Assigns credit to itself (i.e. updates goal attainment weight )and the lastRule by receiving the new PerceivedEnvironment to the Goal and letting the Goal determine the credit assignment to itself (goal attainment) and all of the Rules associated with that Goal, both active and inactive. Assigns the Rule with the highest weight to the activeRule.

    Parameters:
    pPE - The agent's perceived environment.

    runActiveRule

    public java.lang.Object runActiveRule(SensedEnvironment pPE)
    Passes the PerceivedEnvironment to the activeRule in its calculate() method.

    Returns:
    an Object associated with the active Rules calculation

    setPastActiveRule

    public void setPastActiveRule(Rule pRule)
    Sets the PastActiveRule, used for comparison and rule weight calculation

    Parameters:
    pRule - The agent's past active rule.

    setGoalType

    public void setGoalType(int pType)
    Sets the Goals type, the developer should designate specific goal types to be used in the RELATE architecture.

    Parameters:
    pType - Integer representing the goal type.

    setActiveRule

    public void setActiveRule(Rule pRule)
    Sets the ActiveRule, used for goal attainment.

    Parameters:
    pRule - The agent's active rule.

    getGoalType

    public int getGoalType()
    Gets the Goal type

    Returns:
    an Int representing the goal type

    getGoalName

    public java.lang.String getGoalName()
    Gets the Goal name

    Returns:
    a String of the goals name (should be the goal class name)

    getActiveRule

    public Rule getActiveRule()
    Gets the Goal active rule

    Returns:
    the Goals active rule

    getPastActiveRule

    public Rule getPastActiveRule()
    Gets the Goal past active rule

    Returns:
    the Goals oast active rule

    toString

    public java.lang.String toString()
    Returns a formated description of this Goal suitable for printing

    Returns:
    String message describing this Goal object.