EASE.Agents.Engine
Class InstantiatedManager

java.lang.Object
  |
  +--EASE.Agents.Engine.InstantiatedAgent
        |
        +--EASE.Agents.Engine.InstantiatedManager
Direct Known Subclasses:
InstantiatedListAgent

public class InstantiatedManager
extends InstantiatedAgent


Field Summary
 boolean breakContracts
           
protected  java.util.Hashtable contractedAgents
           
protected  java.util.Vector currentContracts
           
protected  Debugger debugger
           
protected  boolean first
           
protected  boolean killed
           
 boolean makeContracts
           
protected  java.util.Vector oldContracts
           
 
Fields inherited from class EASE.Agents.Engine.InstantiatedAgent
listeners, params, parent, parentPriority, paused, sensingEngine, sm, template, userFailEnded, userSuccessEnded
 
Constructor Summary
InstantiatedManager(GenericAgent template, java.util.Hashtable params, InstantiatedAgent parent)
           
 
Method Summary
 void addSubcontractedAgent(InstantiatedContract ic, InstantiatedAgent ia)
          This function is called by the controller to tell the manager which agent it has contracted.
 java.util.Vector breakContracts()
          This function is called by the controller to find out which contracts should be broken.
 void endContract()
          Simply set killed to false.
 boolean execute()
          Manager specific execution.
 java.util.Vector makeContracts()
          This function is called by the controller to find out which contracts should be started.
 boolean terminate()
          Returns whether or not the agent has received an end contract message
 void userPause(boolean pause)
          Pauses/wakes all subcontracted agents.
 
Methods inherited from class EASE.Agents.Engine.InstantiatedAgent
addListener, failing, getName, getParams, getParent, getState, notifyAllChangeListeners, notifyChange, paused, priority, priorityTrace, succeeded, toString, transitionTrace, userEndContract
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

killed

protected boolean killed

first

protected boolean first

makeContracts

public boolean makeContracts

breakContracts

public boolean breakContracts

currentContracts

protected java.util.Vector currentContracts

oldContracts

protected java.util.Vector oldContracts

contractedAgents

protected java.util.Hashtable contractedAgents

debugger

protected Debugger debugger
Constructor Detail

InstantiatedManager

public InstantiatedManager(GenericAgent template,
                           java.util.Hashtable params,
                           InstantiatedAgent parent)
Method Detail

makeContracts

public java.util.Vector makeContracts()
This function is called by the controller to find out which contracts should be started.

Members of the Vector are of type InstantiatedContract.


breakContracts

public java.util.Vector breakContracts()
This function is called by the controller to find out which contracts should be broken.


addSubcontractedAgent

public void addSubcontractedAgent(InstantiatedContract ic,
                                  InstantiatedAgent ia)
This function is called by the controller to tell the manager which agent it has contracted.

The manager needs to keep this information so that it can tell the controller which contracts to break later.


endContract

public void endContract()
Simply set killed to false.

Overrides:
endContract in class InstantiatedAgent

userPause

public void userPause(boolean pause)
Pauses/wakes all subcontracted agents.

Overrides:
userPause in class InstantiatedAgent

terminate

public boolean terminate()
Returns whether or not the agent has received an end contract message

Overrides:
terminate in class InstantiatedAgent

execute

public boolean execute()
Manager specific execution.

Killed is before first in order to get rid of some problems when agent is contracted and killed in the same step. More general sync problem remains.

Overrides:
execute in class InstantiatedAgent