public interface Behavior extends Runnable
This interface represents the behavior of agents. The actual behavior is
implemented within the run()
method. The isFinished()
method indicates whether the behavior requires rescheduling by its
controller. Each behavior is scheduled at least once, independently from the
return value of the method. To this end, the return value of
isFinished()
is always checked after the run()
method has
been executed. If a behavior is not finished, it can indicate when it wants
to be re-scheduled based on the event pattern
specified by the waitingFor()
method.
The Result
can be used as an input for conditional transitions to
subsequent behaviors.
Modifier and Type | Method and Description |
---|---|
boolean |
isFinished()
Indicates whether the behavior is finished or requires re-scheduling.
|
Result |
result()
Returns the result of the behavior.
|
void |
run()
The implementation of the actual behavior.
|
EventPattern |
waitingFor()
Defines the event pattern for re-scheduling.
|
EventPattern waitingFor()
null
if the behavior is finishedboolean isFinished()
true
if the behavior is finished,
false
otherwiseResult result()
Returns the result of the behavior.
Note that the result is only available if the behavior is finished. Otherwise, an illegal-state exception may be thrown.
IllegalStateException
- if the behavior is not finished yetCopyright © Aimpulse Intelligent Systems GmbH
All rights reserved.