Java Reference
In-Depth Information
Figure 6. WakeupCriterion and method
WakeupCriterion()
// Constructor for creating a WakeupCriterion object.
boolean hasTriggered()
// method returning a true if the specified criterion has given rise to the wakeup trigger.
Wakeup criterion
Triggering event
WakeupOnActivation
An object's scheduling region starts to intersect with the
ViewPlatform's activation volume
WakeupOnDeactivation
An object's scheduling region no longer intersects with the
ViewPlatform's activation volume
WakeupOnAWTEvent
A specific AWT event occurs
WakeupOnBehaviorPost
A behavior object posts a specific event
WakeupOnCollisionEntry
A specified object collides with other objects
WakeupOnCollisionExit
A specified object no longer collides with other objects
WakeupOnCollisionMovement
A specified object moves while colliding with other objects
WakeupOnElapsedFrames
The elapsing of a specified number of frames
WakeupOnElapsedTime
The elapsing of a specific number of milliseconds
WakeupOnSensorEntry
A sensor has started to intersect a specified boundary
WakeupOnSensorExit
The sensor no longer intersects the specified boundary
WakeupOnTransformChange
The transform in a specified TransformGroup has changed
WakeupOnViewPlatformEntry
The ViewPlatform's activation volume intersects with the specified
boundary
WakeupOnViewPlatformExit
The ViewPlatform's activation volume no longer intersects the
specified boundary
A simple example illustrating the use of wakeup criterions is presented in Figure 7.
In this example, two wakeup criteria, WakeupOnActivation and WakeupOnDeactivation,
are used.
At the beginning, the bound region has a radius of 50 and the initial wakeup trigger
condition is set to correspond to that for WakeupOnActivation or when the ViewingPlatform
intersects the scheduling regions. Since the two regions do overlap at this time as illustrated,
the system will generate a trigger and control will be passed to the processStimulus method
to deal with this trigger.
In this simple example, the processStimulus method changes the scheduling region by
reducing its bound radius. As can be seen, the new scheduling region will not be intersecting
Search WWH ::




Custom Search