Class ActionMonitor

java.lang.Object
FAtiMA.DeliberativeComponent.ActionMonitor
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ExpirableActionMonitor

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

    Fields
    Modifier and Type
    Field
    Description
    protected FAtiMA.Core.sensorEffector.Event
     
    protected FAtiMA.Core.plans.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

    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
    indicates if the ActionMonitor expired and we should wait no more.
    FAtiMA.Core.plans.Step
    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
     

    Methods inherited from class java.lang.Object

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

    • _step

      protected FAtiMA.Core.plans.Step _step
    • _event

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

    • 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 Details

    • 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 String toString()
      Overrides:
      toString in class Object