public class WaitingObserver extends ObserverAdapter
Modifier and Type | Field and Description |
---|---|
(package private) PrimitiveActionBehaviour |
behaviour
The formula that represents the current behaviour
that was paused in PrimitiveActionBehaviour.action
|
(package private) Agent |
myAgent
The agent who is running this behaviour
|
awakeningThread, DIRECTLY_OBSERVED, lastQueryResultOnDirectlyObserved, myKBase, observedFormulas, timeout, timeoutDisabled, updatedOnce, wakeUpDate
Constructor and Description |
---|
WaitingObserver(KBase kbase,
Formula observedFormula,
PrimitiveActionBehaviour pausedBehaviour,
Agent agent)
Creates a new WaitingObserverAdapter
|
WaitingObserver(KBase kbase,
Formula observedFormula,
PrimitiveActionBehaviour pausedBehaviour,
Agent agent,
Date wakeUp)
Creates a new WaitingObserverAdapter
|
WaitingObserver(KBase kbase,
Formula observedFormula,
PrimitiveActionBehaviour pausedBehaviour,
Agent agent,
long delay)
Creates a new WaitingObserverAdapter
|
Modifier and Type | Method and Description |
---|---|
void |
action(QueryResult result)
Method invoked when the observer is triggered.
|
(package private) PrimitiveActionBehaviour |
getPausedBehaviour()
Returns the paused behavior
|
void |
timeout()
Method triggered at the end of the timeout
or when the wakeUpDate is reached.
|
getObservedFormula, update
addFormula, disableTimeout, getMyKBase, getObservedFormulas, getTimeOut, getWakeUpDate, isEnabledTimeout, toString
PrimitiveActionBehaviour behaviour
Agent myAgent
public WaitingObserver(KBase kbase, Formula observedFormula, PrimitiveActionBehaviour pausedBehaviour, Agent agent)
kbase
- The belief base owning this observerobservedFormula
- the formula to observepausedBehaviour
- the pausedBehaviour to resume when the formula is observedagent
- The agent owning the KBase on which this observer appliespublic WaitingObserver(KBase kbase, Formula observedFormula, PrimitiveActionBehaviour pausedBehaviour, Agent agent, long delay)
kbase
- The belief base owning this observerobservedFormula
- the formula to observepausedBehaviour
- the pausedBehaviour to resume when the formula is observedagent
- The agent owning the KBase on which this observer appliesdelay
- The timeout for waiting for the observed formulapublic WaitingObserver(KBase kbase, Formula observedFormula, PrimitiveActionBehaviour pausedBehaviour, Agent agent, Date wakeUp)
kbase
- The belief base owning this observerobservedFormula
- the formula to observepausedBehaviour
- the pausedBehaviour to resume when the formula is observedagent
- The agent owning the KBase on which this observer applieswakeUp
- The Date for stopping waiting for the observed formulaPrimitiveActionBehaviour getPausedBehaviour()
public void action(QueryResult result)
action
in class ObserverAdapter
result
- list of MatchResults which represents the last queried value of the observed formula.