EASE.Agents.Engine
Class GenericAgent

java.lang.Object
  |
  +--EASE.Agents.Engine.GenericAgent
Direct Known Subclasses:
GenericEngineer, GenericManager

public abstract class GenericAgent
extends java.lang.Object


Field Summary
private  java.util.Vector changeListeners
           
protected  EnvironmentImport environmentImport
           
protected  double intrinsicPriority
           
protected  java.lang.String name
           
protected  java.util.Vector params
           
protected  StateMachine stateMachine
           
private  GenericAgent successor
           
 
Constructor Summary
GenericAgent(java.lang.String name, StateMachine stateMachine, EnvironmentImport envImport, double intrinsicPriority)
           
 
Method Summary
 void addChangeListener(InstantiatedAgent cl)
          Instantiated agents register here so they can be informed of any changes in the generic agent.
 void addParams(java.util.Vector p)
          Add some parameters instantiated at the generic agent level.
 void changeAgent(GenericAgent changed)
          This is called by the change management system to add a new version of the generic agent.
 InstantiatedSM getInstantiatedSM()
          Get the instantiated state machine for this agent.
 ListSensorData getListType()
          Returns an InputListType if there is one for this generic agent or null otherwise.
 java.lang.String getName()
          Name
 java.util.Vector getParams()
          Returns the list of parameters instantiated at generic agent level Note these parameters are for the condition system not for other agents
 GenericAgent getSuccessor()
          This is called by the instantiated agent to get the new version of the agent.
 double priority(java.util.Hashtable params)
          This function returns the aspects of the agents priority that are common to all instantiations.
 double priorityTrace(java.util.Hashtable params, java.lang.StringBuffer sb)
           
 java.lang.String toString()
          Display purposes
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

changeListeners

private java.util.Vector changeListeners

successor

private GenericAgent successor

intrinsicPriority

protected double intrinsicPriority

environmentImport

protected EnvironmentImport environmentImport

stateMachine

protected StateMachine stateMachine

name

protected java.lang.String name

params

protected java.util.Vector params
Constructor Detail

GenericAgent

public GenericAgent(java.lang.String name,
                    StateMachine stateMachine,
                    EnvironmentImport envImport,
                    double intrinsicPriority)
Method Detail

priority

public double priority(java.util.Hashtable params)
This function returns the aspects of the agents priority that are common to all instantiations.

The parameters passed in are those specific to an instantiation.


priorityTrace

public double priorityTrace(java.util.Hashtable params,
                            java.lang.StringBuffer sb)

getInstantiatedSM

public InstantiatedSM getInstantiatedSM()
Get the instantiated state machine for this agent.


getName

public java.lang.String getName()
Name

toString

public java.lang.String toString()
Display purposes
Overrides:
toString in class java.lang.Object

addParams

public void addParams(java.util.Vector p)
Add some parameters instantiated at the generic agent level. Stored as a Vector and translated to Hashtable when combined with instantiated agent params. Note these parameters are for the condition system not for other agents

getParams

public java.util.Vector getParams()
Returns the list of parameters instantiated at generic agent level Note these parameters are for the condition system not for other agents

getListType

public ListSensorData getListType()
Returns an InputListType if there is one for this generic agent or null otherwise.

All the functions that this accesses assume that there is only one InputListType for the agent. This will not usually be true. What is required to be true is that there is only one different type. Then this function works because it gives that type.


addChangeListener

public void addChangeListener(InstantiatedAgent cl)
Instantiated agents register here so they can be informed of any changes in the generic agent.

Once they are notified of the change they can use getNewVersion () to get the changed version of the agent.


changeAgent

public void changeAgent(GenericAgent changed)
This is called by the change management system to add a new version of the generic agent.


getSuccessor

public GenericAgent getSuccessor()
This is called by the instantiated agent to get the new version of the agent.