madkit.message.hook

## Class AgentLifeEvent

- java.lang.Object
- - madkit.kernel.Message
  - - madkit.message.ObjectMessage<HookMessage.AgentActionEvent>
    - - madkit.message.hook.HookMessage
      - - madkit.message.hook.AgentLifeEvent

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

      public class AgentLifeEvent
      extends HookMessage

  A message which is sent to agents that have requested a hook on `HookMessage.AgentActionEvent.AGENT_STARTED` or `HookMessage.AgentActionEvent.AGENT_TERMINATED`
  Since:
    MadKit 5.0.0.19
  Version:
    0.9
  Author:
    Fabien Michel
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class madkit.message.hook.HookMessage

      `HookMessage.AgentActionEvent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgentLifeEvent(HookMessage.AgentActionEvent agentAction, AbstractAgent agent)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `AbstractAgent` | `getSource()` The agent which is related to this event
    `java.lang.String` | `toString()`

    - ### Methods inherited from class madkit.message.ObjectMessage

      `getContent, max, min, sort`

    - ### Methods inherited from class madkit.kernel.Message

      `clone, getConversationID, getReceiver, getSender`

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

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

- - ### Constructor Detail

    - #### AgentLifeEvent

          public AgentLifeEvent(HookMessage.AgentActionEvent agentAction,
                        AbstractAgent agent)

  - ### Method Detail

    - #### getSource

          public AbstractAgent getSource()

      The agent which is related to this event
      Returns:
        the source agent of the event

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `ObjectMessage<HookMessage.AgentActionEvent>`
      See Also:
        `Message.toString()`

Fabien Michel, Olivier Gutknecht, Jacques Ferber - November 18 2014