Package FAtiMA.DeliberativeComponent
Class ActionMonitor
java.lang.Object
FAtiMA.DeliberativeComponent.ActionMonitor
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ExpirableActionMonitor
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 -
Constructor Summary
ConstructorsConstructorDescriptionActionMonitor(FAtiMA.Core.plans.Step step, FAtiMA.Core.sensorEffector.Event actionEnd) Creates a new ActionMonitor that waits forever -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckPreconditions(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 monitoredtoString()
-
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 monitoractionEnd- - 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
-