madkit.kernel
Class Activator

java.lang.Object
  extended by madkit.kernel.Activator
Direct Known Subclasses:
OneValueArgsMethodActivator, TurboMethodActivator

public class Activator
extends java.lang.Object

This tool defines the base class for scheduling mechanisms. An activator is configured according to a community, a group and a role.

Since:
MadKit 2.0
Version:
3.0
Author:
Fabien Michel (MadKit 3.0 05/09/01) and 2.0 (Overlooker)., Olivier Gutknecht version 1.0

Constructor Summary
Activator(java.lang.String groupName, java.lang.String roleName)
           
Activator(java.lang.String communityName, java.lang.String groupName, java.lang.String roleName)
           
 
Method Summary
 void execute()
          this method can be overridden and used to define one behavior for the activator.
 AbstractAgent getAgentNb(int nb)
           
 java.util.ListIterator getAgentsIterator()
          return a ListIterator orver the agents that handle the group/role couple
 java.lang.String getCommunity()
           
 java.util.List getCurrentAgentsList()
          return a list view (a snapshot at moment t) of the agents that handle the group/role couple (in proper sequence)
 java.lang.String getGroup()
           
 java.lang.String getRole()
           
 java.util.ListIterator getShuffledAgentsIterator()
          return a ListIterator that has been previously shuffled
 void initialize()
          this method is automatically invoked the first time the agents variable is updated so it's a good place to initialize activator's parameters like in the SingleMethodActivator for exemple
 int numberOfAgents()
          return the number of the agents that handle the group/role couple
 java.lang.String toString()
           
 void update(AbstractAgent theAgent, boolean added)
          this method is automatically invoked when changes occur on the considered group/role couple
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Activator

public Activator(java.lang.String communityName,
                 java.lang.String groupName,
                 java.lang.String roleName)

Activator

public Activator(java.lang.String groupName,
                 java.lang.String roleName)
Method Detail

initialize

public void initialize()
this method is automatically invoked the first time the agents variable is updated so it's a good place to initialize activator's parameters like in the SingleMethodActivator for exemple


update

public void update(AbstractAgent theAgent,
                   boolean added)
this method is automatically invoked when changes occur on the considered group/role couple

Parameters:
theAgent - is the agent which have been added or removed from the agents collection, the getAgentsList() List)
added - is true if the Agent has been added to the agents collection, false if removed from it

execute

public void execute()
this method can be overridden and used to define one behavior for the activator. It is only defined for genericity purposes : giving developers a generic entry point in the activator class.


getAgentsIterator

public final java.util.ListIterator getAgentsIterator()
return a ListIterator orver the agents that handle the group/role couple

Since:
MadKit 3.0

getShuffledAgentsIterator

public final java.util.ListIterator getShuffledAgentsIterator()
return a ListIterator that has been previously shuffled

Since:
MadKit 3.0

getCurrentAgentsList

public final java.util.List getCurrentAgentsList()
return a list view (a snapshot at moment t) of the agents that handle the group/role couple (in proper sequence)

Since:
MadKit 3.0

numberOfAgents

public final int numberOfAgents()
return the number of the agents that handle the group/role couple


getAgentNb

public final AbstractAgent getAgentNb(int nb)

getCommunity

public final java.lang.String getCommunity()

getGroup

public final java.lang.String getGroup()

getRole

public final java.lang.String getRole()

toString

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


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.