Package 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:
  `Serializable`, `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
  Description
  `AgentLifeEvent(HookMessage.AgentActionEvent agentAction, AbstractAgent agent)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AbstractAgent`
  `getSource()`
  The agent which is related to this event
  `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 Details

  - ### AgentLifeEvent

    public AgentLifeEvent(HookMessage.AgentActionEvent agentAction, AbstractAgent agent)

- ## Method Details

  - ### getSource

    public AbstractAgent getSource()
    The agent which is related to this event
    Returns:
      the source agent of the event

  - ### toString

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