Enum Class KernelAction

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

public enum KernelAction extends Enum<KernelAction>
Enum representing kernel actions. This especially could be used to communicate with the kernel in order to trigger kernel's actions.
Since:
MaDKit 5.0.0.14
  • Enum Constant Details

    • EXIT

      public static final KernelAction EXIT
      Close this MaDKit session
    • COPY

      public static final KernelAction COPY
      Clone the MaDKit session with its initial options
    • RESTART

      public static final KernelAction RESTART
      Restart MaDKit with its initial options
    • LAUNCH_AGENT

      public static final KernelAction LAUNCH_AGENT
      Launch an agent
    • KILL_AGENT

      public static final KernelAction KILL_AGENT
      Kill an agent
  • Method Details

    • values

      public static KernelAction[] 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 KernelAction 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
    • newActionFor

      public Action newActionFor(Agent agent, Object... parameters)
      Returns the action associated with this enum constant for the specified agent, and with the specified parameters.
      Parameters:
      agent - the agent that will perform the action
      parameters - the parameters to be used by the action
      Returns:
      an action that can be used to perform the action
    • request

      public void request(Agent requester, Object... parameters)
      Sends a message to the kernel to perform the action associated with this enum constant, with the specified parameters.
      Parameters:
      requester - the agent that will perform the action
      parameters - the parameters to be used by the action