stop Behavior
Stops the running behavior. With BehaviorStop.AFTER_CYCLE (the default) a cyclic behavior finishes its current cycle and starts no other; a second such call before the cycle ends throws, and isBehaviorStopRequested is the check. With BehaviorStop.NOW, and for a behavior declared with behavior, it ends at once: its process is terminated, releasing anything it holds and running its finally blocks, and a stop not yet begun cancels its start. A stop NOW after a pending AFTER_CYCLE is allowed. Then the action given to onBehaviorStopped runs.
A behavior cannot stop itself NOW, since it is the process running: it returns from its block, or asks to stop after the current cycle.
Parameters
at
how the stop takes effect