Package FAtiMA.DeliberativeComponent
Class ActionMonitor
- java.lang.Object
-
- FAtiMA.DeliberativeComponent.ActionMonitor
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ExpirableActionMonitor
public class ActionMonitor extends java.lang.Object implements java.io.SerializableImplements a monitor capable of verifying if a given action has been achieved. This monitor waits forever.- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
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 booleancheckPreconditions(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 failbooleanexpired()indicates if the ActionMonitor expired and we should wait no more.FAtiMA.Core.plans.StepgetStep()Gets the action that the ActionMonitor is monitoringbooleanmatchEvent(FAtiMA.Core.sensorEffector.Event e)Matches a received event to see if it corresponds to the end of the action that is being monitoredjava.lang.StringtoString()
-
-
-
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 monitoractionEnd- - 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:
toStringin classjava.lang.Object
-
-