EASE.Agents.Engine
Class AgentHolder

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

class AgentHolder
extends java.lang.Object
implements Constants


Inner Class Summary
(package private)  class AgentHolder.SafeThreadGroup
           
 
Field Summary
private  Controller controller
           
private  Debugger debugger
           
 java.util.Vector factories
           
 AgentHolder.SafeThreadGroup factoryThreads
           
 java.util.Hashtable generic
           
 java.util.Vector instantiated
           
 java.util.Vector savedAgents
           
private  java.util.Hashtable savedToInst
           
private  Engine sensing
           
 
Constructor Summary
(package private) AgentHolder()
           
 
Method Summary
 void breakContracts(java.util.Vector contracts)
          Given a list of contracts this sends a message to the associated agents to tell them to the contract is broken.
private  void combine(java.util.Hashtable params, java.util.Vector instParams)
           
private  GenericAgent createAgent(AgentSave as)
          This is the function that creates a genericAgent (for use at runtime from an AgentSave (created by specification).
 InstantiatedAgent makeInstantiatedAgent(InstantiatedContract ic, java.util.Hashtable params, InstantiatedAgent parent)
          Does the actual creation of the instantiated agent.
 void removeAgents(java.util.Vector agents)
          Removes some group of agents from the list of instantiated agents
 void resumeFactories()
          Resume all factories
 void setAgents(java.io.File inputFile)
          Set everything up from a file created by agent spec.
 void startController(ActInterface actuators)
          Start the agent controller
 void startSensing(Interface sensors)
          Start the sensing.
 void stopController()
          Stop the agent controller
 void suspendFactories()
          Suspend all factories.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

factoryThreads

public AgentHolder.SafeThreadGroup factoryThreads

instantiated

public java.util.Vector instantiated

factories

public java.util.Vector factories

generic

public java.util.Hashtable generic

savedAgents

public java.util.Vector savedAgents

savedToInst

private java.util.Hashtable savedToInst

controller

private Controller controller

sensing

private Engine sensing

debugger

private Debugger debugger
Constructor Detail

AgentHolder

AgentHolder()
Method Detail

startController

public void startController(ActInterface actuators)
Start the agent controller

stopController

public void stopController()
Stop the agent controller

startSensing

public void startSensing(Interface sensors)
Start the sensing.


suspendFactories

public void suspendFactories()
Suspend all factories.


resumeFactories

public void resumeFactories()
Resume all factories

setAgents

public void setAgents(java.io.File inputFile)
Set everything up from a file created by agent spec.

Turn the agents from saved state to generic agents.

Stored in hashtable with AgentSave as their key.

Creates and starts the starting agents.


createAgent

private GenericAgent createAgent(AgentSave as)
This is the function that creates a genericAgent (for use at runtime from an AgentSave (created by specification).

makeInstantiatedAgent

public InstantiatedAgent makeInstantiatedAgent(InstantiatedContract ic,
                                               java.util.Hashtable params,
                                               InstantiatedAgent parent)
Does the actual creation of the instantiated agent. The agent is returned after being added to the vector only so that parents etc can have access.

combine

private void combine(java.util.Hashtable params,
                     java.util.Vector instParams)

removeAgents

public void removeAgents(java.util.Vector agents)
Removes some group of agents from the list of instantiated agents

breakContracts

public void breakContracts(java.util.Vector contracts)
Given a list of contracts this sends a message to the associated agents to tell them to the contract is broken.