Class ActionMonitor

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    ExpirableActionMonitor

    public class ActionMonitor
    extends java.lang.Object
    implements java.io.Serializable
    Implements a monitor capable of verifying if a given action has been achieved. This monitor waits forever.
    Author:
    Joao Dias
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected FAtiMA.Core.sensorEffector.Event _event  
      protected FAtiMA.Core.plans.Step _step  
    • Constructor Summary

      Constructors 
      Constructor Description
      ActionMonitor​(FAtiMA.Core.plans.Step step, FAtiMA.Core.sensorEffector.Event actionEnd)
      Creates a new ActionMonitor that waits forever
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean checkPreconditions​(FAtiMA.Core.AgentModel am)
      indicates if the action's preconditions are verified and the action can thus complete if the action's preconditions are not verified, then it means that the action will fail
      boolean expired()
      indicates if the ActionMonitor expired and we should wait no more.
      FAtiMA.Core.plans.Step getStep()
      Gets the action that the ActionMonitor is monitoring
      boolean matchEvent​(FAtiMA.Core.sensorEffector.Event e)
      Matches a received event to see if it corresponds to the end of the action that is being monitored
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _step

        protected FAtiMA.Core.plans.Step _step
      • _event

        protected FAtiMA.Core.sensorEffector.Event _event
    • Constructor Detail

      • ActionMonitor

        public ActionMonitor​(FAtiMA.Core.plans.Step step,
                             FAtiMA.Core.sensorEffector.Event actionEnd)
        Creates a new ActionMonitor that waits forever
        Parameters:
        step - - the plan's step (action) that we want to monitor
        actionEnd - - the event that we should wait for. If this event happens, it means that the action finished
    • Method Detail

      • getStep

        public FAtiMA.Core.plans.Step getStep()
        Gets the action that the ActionMonitor is monitoring
        Returns:
        - the monitored step
      • matchEvent

        public boolean matchEvent​(FAtiMA.Core.sensorEffector.Event e)
        Matches a received event to see if it corresponds to the end of the action that is being monitored
        Parameters:
        e - - the event to compare
        Returns:
        true if the received event corresponds to the end of the monitored action, false otherwise
      • expired

        public boolean expired()
        indicates if the ActionMonitor expired and we should wait no more. Since this action monitor waits forever, it never expires.
        Returns:
        allways returns false
      • checkPreconditions

        public boolean checkPreconditions​(FAtiMA.Core.AgentModel am)
        indicates if the action's preconditions are verified and the action can thus complete if the action's preconditions are not verified, then it means that the action will fail
        Returns:
        status
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object