EASE.Agents.Engine
Class AllAgents

java.lang.Object
  |
  +--EASE.Agents.Engine.AllAgents

public class AllAgents
extends java.lang.Object
implements Constants

This class holds all the agents for both the controller and the specification interface.

At the moment only the engine really uses this, except for debugging purposes. Uses singleton pattern.


Field Summary
private static java.io.File agentFile
           
private static java.io.File condFile
           
private static Debugger debugger
           
private static Interface inInt
           
private static java.util.Vector listeners
           
private static ActInterface outInt
           
private static AgentHolder theAgents
           
 
Constructor Summary
AllAgents()
           
 
Method Summary
 InstantiatedAgent addInstantiated(InstantiatedContract ic, java.util.Hashtable params, InstantiatedAgent parent)
          Create a new instantiated agent and add it to the list of instantiated agents.
 void addListener(AgentListener l)
          Add an agent listener
 void breakContracts(java.util.Vector contracts)
          Called by an agent to break the contracts in the Vector.
 java.util.Vector getFactories()
          Gets all the factories.
 Factory getFactory(java.lang.String name)
          Get a factory by name.
 java.lang.ThreadGroup getFactoryThreads()
          Access to the factory thread group
 java.util.Hashtable getGeneric()
           
 java.util.Vector getInstantiated()
          Get all instantiated agents
 java.util.Vector getSaved()
           
 void loadAgents(java.io.File f)
          Specificies an agent file to use (does not load).
 void removeInstantiated(java.util.Vector agents)
          Take an instantiated agent off the list.
 void resumeFactories()
          Used by the start control to start the factories.
 void setFactories(java.util.Vector f)
          Sets the factories for the domain.
 void setInputInterface(Interface inter)
          Sets the input interface for the simulated thing.
 void setOutputInterface(ActInterface inter)
          Sets the output interface for the simulated thing.
 void start()
          Starts the controller
 void stop()
          Stop the controller
 void suspendFactories()
          Used by the start control to stop the factories.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

theAgents

private static AgentHolder theAgents

outInt

private static ActInterface outInt

inInt

private static Interface inInt

debugger

private static Debugger debugger

condFile

private static java.io.File condFile

agentFile

private static java.io.File agentFile

listeners

private static java.util.Vector listeners
Constructor Detail

AllAgents

public AllAgents()
Method Detail

getInstantiated

public java.util.Vector getInstantiated()
Get all instantiated agents


getGeneric

public java.util.Hashtable getGeneric()

getSaved

public java.util.Vector getSaved()

addInstantiated

public InstantiatedAgent addInstantiated(InstantiatedContract ic,
                                         java.util.Hashtable params,
                                         InstantiatedAgent parent)
Create a new instantiated agent and add it to the list of instantiated agents.


removeInstantiated

public void removeInstantiated(java.util.Vector agents)
Take an instantiated agent off the list.


breakContracts

public void breakContracts(java.util.Vector contracts)
Called by an agent to break the contracts in the Vector.


getFactories

public java.util.Vector getFactories()
Gets all the factories.


suspendFactories

public void suspendFactories()
Used by the start control to stop the factories.


resumeFactories

public void resumeFactories()
Used by the start control to start the factories.


getFactory

public Factory getFactory(java.lang.String name)
Get a factory by name.

If the factory is part of a vector factory return the top level vector factory.


loadAgents

public void loadAgents(java.io.File f)
Specificies an agent file to use (does not load).


setOutputInterface

public void setOutputInterface(ActInterface inter)
Sets the output interface for the simulated thing.


setInputInterface

public void setInputInterface(Interface inter)
Sets the input interface for the simulated thing.


setFactories

public void setFactories(java.util.Vector f)
Sets the factories for the domain.

Need to start and suspend each factory to ensure that resume works in controller.


start

public void start()
Starts the controller

stop

public void stop()
Stop the controller

getFactoryThreads

public java.lang.ThreadGroup getFactoryThreads()
Access to the factory thread group

addListener

public void addListener(AgentListener l)
Add an agent listener