Package jade.core

Class LifeCycle

  • All Implemented Interfaces:
    Serializable, Serializable

    public abstract class LifeCycle
    extends Object
    implements Serializable
    Common bas class for all agent life cycle states. Note that a single LifeCycle object may represent more than one agent state.
    Author:
    Giovanni Caire - TILAB
    See Also:
    Serialized Form
    • Field Detail

      • myAgent

        protected Agent myAgent
      • myState

        protected int myState
    • Constructor Detail

      • LifeCycle

        public LifeCycle​(int s)
    • Method Detail

      • init

        public void init()
        This method is invoked when the agent thread starts
      • end

        public void end()
        This method is invoked when the agent thread termiantes
      • alive

        public boolean alive()
        Specifies whether or not this is a termination state
      • getState

        public int getState()
      • transitionFrom

        public void transitionFrom​(LifeCycle from)
        This method is invoked as soon as we enter this LifeCycle state. When this method is executed this LifeCycle object is the current agent LifeCycle.
      • transitionTo

        public boolean transitionTo​(LifeCycle to)
        This method is invoked just before leaving this LifeCycle state. When this method is executed this LifeCycle object is still the current agent LifeCycle. The boolean return value is used to prevent transitions to certain states. In that case the life cycle state does not change.
      • isMessageAware

        public boolean isMessageAware()
        Specifies whether or not the agent should react to incoming messages when in this LifeCycle state.