demo.helicopter
Class RoleSquadMember

java.lang.Object
  extended bydemo.helicopter.RoleSquadMember
All Implemented Interfaces:
Role

public class RoleSquadMember
extends java.lang.Object
implements Role

A Role object brings additional capabilities and responsibilities to a host Agent. This can include, but is not limited to, sensors, goals (with their associated Rules), and methods to act upon itself and its environment.

Since:
JDK1.3
Version:
0.2, 20 Jul 00
Author:
Michael R. Dickson, Kimberly A. Roddy

Constructor Summary
RoleSquadMember()
          Default constructor
 
Method Summary
 void addAction(Action pAction)
          Adds the indicated action to the actionList
 void addNewGoal(Goal pGoal)
          Adds the passed in Goal to the goalList.
 void addSensor(Sensor pSensor)
          Adds the indicated sensor to the sensorList
 java.util.Vector getActionListVec()
          Getter for actionList.
 java.util.Vector getGoalListVec()
          Getter for goalList
 java.lang.String getRoleName()
          Gets the role name
 java.util.Vector getSensorListVec()
          Getter for sensorList
 boolean removeAction(Action pAction)
          Removes the indicated action from the actionList
 boolean removeGoal(Goal pGoal)
          Interface Requirements
 boolean removeSensor(Sensor pSensor)
          Removes the indicated sensor from the sensorList
 void setActionList(java.util.Vector pActionList)
          Setter for actionList.
 void setRoleName(java.lang.String pRoleName)
          Sets the role name of the role object, this should be the exact class name of the role.
 void setSensorList(java.util.Vector pSensorList)
          Setter for sensorList
 java.lang.String toString()
          Getter and setter group
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoleSquadMember

public RoleSquadMember()
Default constructor

Method Detail

addNewGoal

public void addNewGoal(Goal pGoal)
Adds the passed in Goal to the goalList.

Specified by:
addNewGoal in interface Role
Parameters:
pGoal -

removeGoal

public boolean removeGoal(Goal pGoal)
Interface Requirements

Specified by:
removeGoal in interface Role
Parameters:
pGoal -
Returns:
The success of the removal operation:
  • true - The Goal was successfully removed
  • false - The Goal did not exist in the Role's goalList

  • removeSensor

    public boolean removeSensor(Sensor pSensor)
    Description copied from interface: Role
    Removes the indicated sensor from the sensorList

    Specified by:
    removeSensor in interface Role
    Parameters:
    pSensor - An integer representing the sensor to be removed
    Returns:
    The success of the removal operation:
  • true - The sensor was successfully removed
  • false - The sensor did not exist in the Role's sensorList

  • addSensor

    public void addSensor(Sensor pSensor)
    Description copied from interface: Role
    Adds the indicated sensor to the sensorList

    Specified by:
    addSensor in interface Role
    Parameters:
    pSensor - An integer representing the sensor to be added

    removeAction

    public boolean removeAction(Action pAction)
    Description copied from interface: Role
    Removes the indicated action from the actionList

    Specified by:
    removeAction in interface Role
    Parameters:
    pAction - The action to be removed
    Returns:
    The success of the removal operation:
  • true - The action was successfully removed
  • false - The action did not exist in the Role's actionList

  • addAction

    public void addAction(Action pAction)
    Description copied from interface: Role
    Adds the indicated action to the actionList

    Specified by:
    addAction in interface Role
    Parameters:
    pAction - The action to be added

    toString

    public java.lang.String toString()
    Getter and setter group


    getGoalListVec

    public java.util.Vector getGoalListVec()
    Description copied from interface: Role
    Getter for goalList

    Specified by:
    getGoalListVec in interface Role
    Returns:
    goalList vector

    getSensorListVec

    public java.util.Vector getSensorListVec()
    Description copied from interface: Role
    Getter for sensorList

    Specified by:
    getSensorListVec in interface Role
    Returns:
    sensorList vector

    setSensorList

    public void setSensorList(java.util.Vector pSensorList)
    Description copied from interface: Role
    Setter for sensorList

    Specified by:
    setSensorList in interface Role
    Parameters:
    pSensorList -

    setRoleName

    public void setRoleName(java.lang.String pRoleName)
    Description copied from interface: Role
    Sets the role name of the role object, this should be the exact class name of the role.

    Specified by:
    setRoleName in interface Role
    Parameters:
    pRoleName - The role name

    getRoleName

    public java.lang.String getRoleName()
    Description copied from interface: Role
    Gets the role name

    Specified by:
    getRoleName in interface Role
    Returns:
    The "string" role name.

    getActionListVec

    public java.util.Vector getActionListVec()
    Description copied from interface: Role
    Getter for actionList. Returns a Vector containing a list of integers representing all of the actions available to the agent due to this Role

    Specified by:
    getActionListVec in interface Role
    Returns:
    actionList

    setActionList

    public void setActionList(java.util.Vector pActionList)
    Description copied from interface: Role
    Setter for actionList. Replaces the actionList Vector with a new list of integers representing all of the actions available to the agent due to this Role

    Specified by:
    setActionList in interface Role
    Parameters:
    pActionList -