Package madkit.kernel

# Enum Class AbstractAgent.State

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

All Implemented Interfaces:
  `Serializable`, `Comparable<AbstractAgent.State>`, `java.lang.constant.Constable`

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()`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  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

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

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

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

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

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

- ## Enum Constant Details

  - ### 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 Details

  - ### values

    public static AbstractAgent.State[] 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 AbstractAgent.State 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