madkit.kernel

## Enum AbstractAgent.State

- java.lang.Object
- - java.lang.Enum<AbstractAgent.State>
  - - madkit.kernel.AbstractAgent.State

- All Implemented Interfaces:
    Serializable, Comparable<AbstractAgent.State>
  Enclosing class:
    AbstractAgent

      public static enum AbstractAgent.State
      extends Enum<AbstractAgent.State>

  An agent state. An agent can be in one of the following states:
  - `NOT_LAUNCHED`
    An agent which has not yet been launched is in this state.
  - `INITIALIZING`
    An agent that has been launched but which has not started its `AbstractAgent.activate()` method yet is in this state.
  - `ACTIVATED`
    An agent that is processing its `AbstractAgent.activate()` method is in this state.
  - `LIVING`
    An agent that is processing its `Agent.live()` method is in this state.
  - `ENDING`
    An agent that is processing its `AbstractAgent.end()` method is in this state.
  - `TERMINATED`
    An agent which has finished its life cycle is in this state.

  An agent can be in only one state at a given point in time.

  Since:
    MaDKit 5.0
  Author:
    Fabien Michel
  See Also:
    `AbstractAgent.getState()`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ACTIVATED` The agent is processing its `AbstractAgent.activate()` method.
    `ENDING` The agent is processing its `AbstractAgent.end()` method.
    `INITIALIZING` The agent has been launched and is being registered by the kernel but it has not started its `AbstractAgent.activate()` method yet.
    `LIVING` The agent is processing its `Agent.live()` method.
    `NOT_LAUNCHED` The agent has not been launched yet.
    `TERMINATED` The agent has finished its life cycle in the MaDKit platform.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static AbstractAgent.State` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static AbstractAgent.State[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### NOT_LAUNCHED

          public static final AbstractAgent.State NOT_LAUNCHED

      The agent has not been launched yet.

    - #### INITIALIZING

          public static final AbstractAgent.State INITIALIZING

      The agent has been launched and is being registered by the kernel but it has not started its `AbstractAgent.activate()` method yet.

    - #### ACTIVATED

          public static final AbstractAgent.State ACTIVATED

      The agent is processing its `AbstractAgent.activate()` method. This state is also the "running" state of `AbstractAgent` subclasses (i.e. when they have finished their activation) as they do not have a `Agent.live()` managed by the kernel in their life cycle. On the contrary to `Agent` subclasses which next state is `LIVING`).

    - #### LIVING

          public static final AbstractAgent.State LIVING

      The agent is processing its `Agent.live()` method.

    - #### ENDING

          public static final AbstractAgent.State ENDING

      The agent is processing its `AbstractAgent.end()` method.

    - #### TERMINATED

          public static final AbstractAgent.State TERMINATED

      The agent has finished its life cycle in the MaDKit platform.

  - ### Method Detail

    - #### values

          public static AbstractAgent.State[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (AbstractAgent.State c : AbstractAgent.State.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static AbstractAgent.State valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        `NullPointerException` - if the argument is null

Fabien Michel, Olivier Gutknecht, Jacques Ferber - February 12 2016