madkit.simulation.scheduler

## Class DateBasedDiscreteEventScheduler

- java.lang.Object
- - madkit.kernel.AbstractAgent
  - - madkit.kernel.Agent
    - - madkit.kernel.Scheduler
      - - madkit.simulation.scheduler.DateBasedDiscreteEventScheduler

- All Implemented Interfaces:
    java.lang.Comparable<AbstractAgent>

      public class DateBasedDiscreteEventScheduler
      extends Scheduler

- - ### 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
    Constructor and Description
    `DateBasedDiscreteEventScheduler()`
    `DateBasedDiscreteEventScheduler(java.time.LocalDateTime initialDate)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addActivator(Activator<? extends AbstractAgent> activator)` Adds an activator to the simulation engine.
    `void` | `doSimulationStep()` Defines a default simulation loop which is automatically during the scheduler's life.
    `java.util.PriorityQueue<DateBasedDiscreteEventActivator<? extends AbstractAgent>>` | `getActivationList()`
    `void` | `logActivationStep()` 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, 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, 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DateBasedDiscreteEventScheduler

          public DateBasedDiscreteEventScheduler()

    - #### DateBasedDiscreteEventScheduler

          public DateBasedDiscreteEventScheduler(java.time.LocalDateTime initialDate)

  - ### Method Detail

    - #### 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, using `Activator.execute(Object...)`, and then increments the simulation time by one unit. Default implementation is:

           logActivationStep();
           for (final Activator activator : activators) {
               executeAndLog(activator);
           }
           getSimulationTime().addOneTimeUnit();

      By default logs are displayed only if `AbstractAgent.getLogger()` is set above `Level.FINER`.
      Overrides:
        `doSimulationStep` in class `Scheduler`

    - #### addActivator

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

      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 class `Scheduler`
      Parameters:
        `activator` - an activator.

    - #### logActivationStep

          public void logActivationStep()

      Description copied from class: `Scheduler`
      Logs the current simulation step value. logs are displayed only if `AbstractAgent.getLogger()` is set above `Level.FINER`.
      Overrides:
        `logActivationStep` in class `Scheduler`

    - #### getActivationList

          public java.util.PriorityQueue<DateBasedDiscreteEventActivator<? extends AbstractAgent>> getActivationList()

Fabien Michel, Olivier Gutknecht, Jacques Ferber - September 9 2019