Class BDILifecycleAgentFeature

java.lang.Object
jadex.micro.impl.MicroAgentFeature
jadex.bdi.runtime.impl.BDILifecycleAgentFeature
All Implemented Interfaces:
IInternalBDILifecycleFeature, jadex.execution.impl.ILifecycle

public class BDILifecycleAgentFeature extends jadex.micro.impl.MicroAgentFeature implements IInternalBDILifecycleFeature
Feature that ensures the agent created(), body() and killed() are called on the pojo.
  • Field Details

    • inited

      protected boolean inited
      Is the agent inited and allowed to execute rules?
    • shutdown

      protected boolean shutdown
      Is the agent in shutdown?.
  • Constructor Details

    • BDILifecycleAgentFeature

      protected BDILifecycleAgentFeature(jadex.micro.MicroAgent self)
      Instantiate the feature.
  • Method Details

    • onStart

      public jadex.future.IFuture<Void> onStart()
      Execute the functional body of the agent. Is only called once.
      Specified by:
      onStart in interface jadex.execution.impl.ILifecycle
      Overrides:
      onStart in class jadex.micro.impl.MicroAgentFeature
    • createStartBehavior

      protected BDILifecycleAgentFeature.StartBehavior createStartBehavior()
      Create the start behavior.
    • createEndBehavior

      protected BDILifecycleAgentFeature.EndBehavior createEndBehavior()
      Create the end behavior.
    • onEnd

      public jadex.future.IFuture<Void> onEnd()
      Specified by:
      onEnd in interface jadex.execution.impl.ILifecycle
      Overrides:
      onEnd in class jadex.micro.impl.MicroAgentFeature
    • executeGoalMethod

      protected static boolean executeGoalMethod(Method m, RProcessableElement goal, jadex.rules.eca.IEvent event)
      Execute a goal method.
    • invokeBooleanMethod

      public static boolean invokeBooleanMethod(Object pojo, Method m, MElement modelelement, jadex.rules.eca.IEvent event, RPlan rplan)
      Assemble fitting parameters from context and invoke a boolean method.
    • isInited

      public boolean isInited()
      Get the inited.
      Specified by:
      isInited in interface IInternalBDILifecycleFeature
      Returns:
      The inited.
    • setInited

      public void setInited(boolean inited)
      The inited to set.
      Specified by:
      setInited in interface IInternalBDILifecycleFeature
      Parameters:
      inited - The inited to set
    • isShutdown

      public boolean isShutdown()
      Get the shutdown.
      Specified by:
      isShutdown in interface IInternalBDILifecycleFeature
      Returns:
      The shutdown
    • setShutdown

      public void setShutdown(boolean shutdown)
      Set the shutdown.
      Specified by:
      setShutdown in interface IInternalBDILifecycleFeature
      Parameters:
      shutdown - The shutdown to set
    • evaluateCondition

      public static boolean evaluateCondition(MCondition cond, MElement owner, Map<String,Object> vals)
      Evaluate the condition.
      Returns: