madkit.kernel
Class Scheduler

java.lang.Object
  extended by madkit.kernel.AbstractAgent
      extended by madkit.kernel.Agent
          extended by madkit.kernel.Scheduler
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable
Direct Known Subclasses:
BeeScheduler, TurtleScheduler, WarbotScheduler

public abstract class Scheduler
extends Agent

This class defines a generic threaded scheduler agent. It holds a collection of activators.

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
See Also:
Serialized Form

Constructor Summary
Scheduler()
           
 
Method Summary
 void addActivator(Activator<? extends AbstractAgent> activator)
           
 void addActivator(Activator<? extends AbstractAgent> activator, java.lang.Object accessCard)
           
 void end()
          the end method will remove all the activators which have been used by the scheduler.
 Activator<? extends AbstractAgent>[] getActivators()
          Gets the activators.
 void removeActivator(Activator<? extends AbstractAgent> activator)
           
 void removeAllActivators()
           
 
Methods inherited from class madkit.kernel.Agent
connectAgencyToAgency, createPlace, createPlace, enableMobility, enableMobility, exitImmediatlyOnKill, getAgencyNamed, joinPlace, joinPlace, joinPlace, live, pause, receiveMessage, run, waitNextMessage, waitNextMessage
 
Methods inherited from class madkit.kernel.AbstractAgent
activate, broadcastMessage, broadcastMessage, connectedWithCommunity, createGroup, createGroup, debug, destroyGroup, disposeMyGUI, foundGroup, getAddress, getAgentsWithRole, getAgentsWithRole, getAgentWithRole, getAgentWithRole, getAvailableCommunities, getBean, getController, getCurrentKernelAddress, getDebug, getExistingGroups, getExistingGroups, getExistingRoles, getExistingRoles, getGroups, getGUIObject, getMessageBoxSize, getMyGroups, getMyGroups, getMyRoles, getMyRoles, getName, getRoles, hasGUI, hashCode, hideMyGUI, initGUI, isBelongingToGroup, isBelongingToGroup, isCommunity, isGroup, isGroup, isMemberOf, isMemberOf, isMessageBoxEmpty, isRole, isRole, joinGroup, killAgent, launchAgent, launchAgent, leaveGroup, leaveGroup, leaveRole, leaveRole, nextMessage, print, println, redisplayMyGUI, requestRole, requestRole, requestRole, restoreAgent, sendMessage, sendMessage, sendMessage, setBean, setController, setDebug, setGUIObject, setName, setOutput, setOutputWriter, toString, windowClosing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Scheduler

public Scheduler()
Method Detail

addActivator

public void addActivator(Activator<? extends AbstractAgent> activator)

addActivator

public void addActivator(Activator<? extends AbstractAgent> activator,
                         java.lang.Object accessCard)

removeActivator

public void removeActivator(Activator<? extends AbstractAgent> activator)

getActivators

public final Activator<? extends AbstractAgent>[] getActivators()
Gets the activators.

Returns:
the activators

removeAllActivators

public void removeAllActivators()

end

public void end()
the end method will remove all the activators which have been used by the scheduler. Overriding this method, one should use super.end() first in order to ease the removal of simulated agents which will be killed. Doing so can greatly improved the "killing time" of simulation engines

Overrides:
end in class AbstractAgent
See Also:
AbstractAgent.end()


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