gr.demokritos.iit.jinsect.distributed
Class ActivateAgentListBehaviour

java.lang.Object
  extended by jade.core.behaviours.Behaviour
      extended by jade.core.behaviours.SimpleBehaviour
          extended by jade.core.behaviours.WakerBehaviour
              extended by gr.demokritos.iit.jinsect.distributed.ActivateAgentListBehaviour
All Implemented Interfaces:
java.io.Serializable

public class ActivateAgentListBehaviour
extends jade.core.behaviours.WakerBehaviour

This class initializes a set of calculating agents and randomly dispatches them to various containers. It waits every agent to inform for its arrival at the container, via a corresponding ReceiveResultBehaviour. Then it contacts every agent, in round robin sending it data to perform calculations and routes receive behaviors to accept those results.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.behaviours.Behaviour
jade.core.behaviours.Behaviour.RunnableChangedEvent
 
Field Summary
 
Fields inherited from class jade.core.behaviours.Behaviour
myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
 
Constructor Summary
ActivateAgentListBehaviour(ResultsAgent a, long lInterval, java.util.Queue lCalcArgs, java.io.PrintStream pOut, double dMigrationProbability, java.lang.Object[] oaAgentArgs)
          Creates the dispatching agent, given a set of calculation arguments to forward to created calculation agents and a migration probability for newly created agents.
 
Method Summary
protected  void onWake()
          Performs the creation and dispatchiong of calculating agents, as well as the routing of calculation parameters to them.
 
Methods inherited from class jade.core.behaviours.WakerBehaviour
action, done, getWakeupTime, handleElapsedTimeout, reset, reset, stop
 
Methods inherited from class jade.core.behaviours.SimpleBehaviour
reset
 
Methods inherited from class jade.core.behaviours.Behaviour
actionWrapper, block, block, getBehaviourName, getDataStore, getExecutionState, getParent, handle, isRunnable, onEnd, onStart, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivateAgentListBehaviour

public ActivateAgentListBehaviour(ResultsAgent a,
                                  long lInterval,
                                  java.util.Queue lCalcArgs,
                                  java.io.PrintStream pOut,
                                  double dMigrationProbability,
                                  java.lang.Object[] oaAgentArgs)
Creates the dispatching agent, given a set of calculation arguments to forward to created calculation agents and a migration probability for newly created agents.

Parameters:
a - The agent that will manage the results of the calculations.
lInterval - The interval in millisecs after which the agent will act again until all calculations have been routed.
lCalcArgs - A list of calculation arguments that wil lbe sent to the calculating agents.
pOut - The debug output stream.
dMigrationProbability - The probability that agents created will migrate to other containers.
oaAgentArgs - An array of arguments, common to all agents created.
Method Detail

onWake

protected void onWake()
Performs the creation and dispatchiong of calculating agents, as well as the routing of calculation parameters to them. Also, queues behaviours for the reception of results.

Overrides:
onWake in class jade.core.behaviours.WakerBehaviour