Package madkit.simulation.scheduler
Class DateBasedDiscreteEventScheduler
java.lang.Object
madkit.kernel.AbstractAgent
madkit.kernel.Agent
madkit.kernel.Scheduler
madkit.simulation.scheduler.DateBasedDiscreteEventScheduler
- All Implemented Interfaces:
Comparable<AbstractAgent>
-
Nested Class Summary
Nested classes/interfaces inherited from class madkit.kernel.Scheduler
Scheduler.SimulationState, Scheduler.SimulationTime
Nested classes/interfaces inherited from class madkit.kernel.AbstractAgent
AbstractAgent.ReturnCode, AbstractAgent.State
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActivator
(Activator<? extends AbstractAgent> activator) Adds an activator to the simulation engine.void
Defines a default simulation loop which is automatically during the scheduler's life.void
Logs the current simulation step value.Methods inherited from class madkit.kernel.Scheduler
checkMail, end, executeAndLog, getDelay, getGVT, getGVTLabel, getSchedulerMenu, getSchedulerStatusLabel, getSchedulerToolBar, getSimulationDuration, getSimulationState, live, paused, removeActivator, removeAllActivators, setActivatorPriority, setDelay, setGVT, setSimulationDuration, setSimulationState, setupFrame
Methods inherited from class madkit.kernel.Agent
broadcastMessageWithRoleAndWaitForReplies, getThreadPriority, isDaemon, killAgent, pause, sendMessageAndWaitForReply, sendMessageAndWaitForReply, sendMessageAndWaitForReply, sendMessageAndWaitForReply, sendMessageWithRoleAndWaitForReply, sendMessageWithRoleAndWaitForReply, sendMessageWithRoleAndWaitForReply, sendMessageWithRoleAndWaitForReply, sendReplyAndWaitForReply, sendReplyAndWaitForReply, sendReplyWithRoleAndWaitForReply, sendReplyWithRoleAndWaitForReply, setThreadPriority, waitAnswer, waitAnswer, waitNextMessage, waitNextMessage, waitNextMessage, waitNextMessage
Methods inherited from class madkit.kernel.AbstractAgent
activate, broadcastMessage, broadcastMessageWithRole, bucketModeCreateGroup, bucketModeRequestRole, checkAgentAddress, compareTo, createGroup, createGroup, createGroup, createGroupIfAbsent, createGroupIfAbsent, createGroupIfAbsent, createGUIOnStartUp, destroyCommunity, destroyGroup, destroyRole, executeThisAgent, executeThisAgent, executeThisAgent, getAgentAddressIn, getAgentsWithRole, getAgentsWithRole, getAgentWithRole, getDistantAgentWithRole, getExistingCommunities, getExistingGroups, getExistingRoles, getKernelAddress, getLastReceivedMessage, getLastReceivedMessage, getLogger, getMadkitConfig, getMadkitProperty, getMadkitProperty, getMyGroups, getMyRoles, getName, getNetworkID, getNextEventDate, getOrganizationSnapShot, getReplyTo, getServerInfo, getSimpleNetworkID, getSimulationTime, getState, hasGUI, hashCode, hasRole, isAlive, isCommunity, isGroup, isKernelOnline, isMadkitPropertyTrue, isMessageBoxEmpty, isRole, killAgent, launchAgent, launchAgent, launchAgent, launchAgent, launchAgent, launchAgent, launchAgent, launchAgent, launchAgentBucket, launchAgentBucket, launchAgentBucket, launchAgentBucket, launchNode, launchXmlAgents, leaveGroup, leaveRole, nextMessage, nextMessage, nextMessages, proceedEnumMessage, purgeMailbox, receiveMessage, reload, requestRole, requestRole, sendMessage, sendMessage, sendMessageWithRole, sendMessageWithRole, sendReply, sendReplyWithRole, setLogLevel, setMadkitProperty, setMadkitProperty, setName, toString
-
Constructor Details
-
DateBasedDiscreteEventScheduler
public DateBasedDiscreteEventScheduler() -
DateBasedDiscreteEventScheduler
-
-
Method Details
-
doSimulationStep
public void doSimulationStep()Description copied from class:Scheduler
Defines a default simulation loop which is automatically during the scheduler's life. This method should be overridden to define a customized scheduling policy. By default, it executes all the activators in the order they have been added, usingActivator.execute(Object...)
, and then increments the simulation time by one unit. Default implementation is:logActivationStep(); for (final Activator<? extends AbstractAgent> activator : activators) { executeAndLog(activator); } getSimulationTime().addOneTimeUnit();
By default logs are displayed only ifAbstractAgent.getLogger()
is set aboveLevel.FINER
.- Overrides:
doSimulationStep
in classScheduler
-
addActivator
Description copied from class:Scheduler
Adds an activator to the simulation engine. This has to be done to make an activator work properly.- Overrides:
addActivator
in classScheduler
- Parameters:
activator
- an activator.
-
logActivationStep
public void logActivationStep()Description copied from class:Scheduler
Logs the current simulation step value. logs are displayed only ifAbstractAgent.getLogger()
is set aboveLevel.FINER
.- Overrides:
logActivationStep
in classScheduler
-
getActivationList
-