Enum Class SchedulingAction

java.lang.Object
java.lang.Enum<SchedulingAction>
madkit.action.SchedulingAction
All Implemented Interfaces:
Serializable, Comparable<SchedulingAction>, Constable

public enum SchedulingAction extends Enum<SchedulingAction>
Enum representing operations which could be done by a Scheduler agent. It could be used by an agent to interact with the scheduler by creating actions using getActionFrom(Scheduler, Object...).
  • Enum Constant Details

    • RUN

      public static final SchedulingAction RUN
      Makes the scheduler run the simulation
    • STEP

      public static final SchedulingAction STEP
      Makes the scheduler do one step of the simulation
    • PAUSE

      public static final SchedulingAction PAUSE
      Makes the scheduler pause the simulation
    • SHUTDOWN

      public static final SchedulingAction SHUTDOWN
      Makes the scheduler stop the simulation
  • Method Details

    • values

      public static SchedulingAction[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SchedulingAction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getActionData

      public ActionData getActionData()
      Returns the action data corresponding to this enum.
      Returns:
      the actionData corresponding to this enum.
    • getActionFrom

      public Action getActionFrom(Scheduler<?> agent, Object... parameters)
      Builds an FX action that will make the kernel do the corresponding operation if possible.
      Parameters:
      agent - the agent that will send the message to the scheduler
      parameters - the parameters to send to the scheduler
      Returns:
      the new corresponding action
    • createActionGroup

      public static ActionGroup createActionGroup(Scheduler<?> scheduler)
      Creates an action group for the given Scheduler agent. The action group includes actions for running and pausing the scheduler.
      Parameters:
      scheduler - the scheduler agent to create the action group for
      Returns:
      the action group corresponding to the given scheduler