cdx
Class ReducerHandler

java.lang.Object
  extended by javax.safetycritical.AbstractAsyncEventHandler
      extended by javax.safetycritical.AsyncEventHandler
          extended by javax.safetycritical.BoundAsyncEventHandler
              extended by javax.safetycritical.ManagedEventHandler
                  extended by javax.safetycritical.AperiodicEventHandler
                      extended by cdx.ReducerHandler
All Implemented Interfaces:
java.lang.Runnable, javax.safetycritical.ManagedSchedulable, javax.safetycritical.Schedulable

public class ReducerHandler
extends javax.safetycritical.AperiodicEventHandler

ReducerHandler performs two preparational tasks prior to the parallel detection phase. First, it carries out voxel hashing which results in aircrafts being assigned to voxels in a way that it is sufficient to check for collisions within each voxel in order to obtain an upper bound on the number of actual collisions. Secondly, it divides and distributes the computational work between the parallel DetectorHandler instances.


Field Summary
 DetectorControl control
          The control of DetectorControl which starts before releasing all DetectorHandler
 javax.safetycritical.AperiodicEvent detect
          The event to release all DetectorHandlers
 PersistentData factories
          Pseudo object factory to manage pre-allocated objects in mission memory.
 CDxMission mission
          The current mission
 
Constructor Summary
ReducerHandler(CDxMission mission, javax.safetycritical.AperiodicEvent event, DetectorControl control, javax.safetycritical.AperiodicEvent event_bound)
          Constructor
 
Method Summary
 List createMotions()
          Creates a list of persistent Motion objects (in mission memory) from the current and previous aircraft positions in currentFrame and state.
 void handleEvent()
          The major method of the ReducerHandler, in which implements the reduction, updates the shared variables in the mission so that the DetectorHandler can access it, and also releases all DetectorHandlers.
 void reduceAndPartitionMotions(Reducer reducer, List motions)
          Method to input a list of motions to a reducer to implement the reduction based on voxels hashing.
 
Methods inherited from class javax.safetycritical.AperiodicEventHandler
register
 
Methods inherited from class javax.safetycritical.ManagedEventHandler
cleanup, getName
 
Methods inherited from class javax.safetycritical.AsyncEventHandler
handleAsyncEvent
 
Methods inherited from class javax.safetycritical.AbstractAsyncEventHandler
run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

mission

public final CDxMission mission
The current mission


detect

public final javax.safetycritical.AperiodicEvent detect
The event to release all DetectorHandlers


control

public final DetectorControl control
The control of DetectorControl which starts before releasing all DetectorHandler


factories

public final PersistentData factories
Pseudo object factory to manage pre-allocated objects in mission memory.

Constructor Detail

ReducerHandler

public ReducerHandler(CDxMission mission,
                      javax.safetycritical.AperiodicEvent event,
                      DetectorControl control,
                      javax.safetycritical.AperiodicEvent event_bound)
Constructor

Method Detail

handleEvent

public void handleEvent()
The major method of the ReducerHandler, in which implements the reduction, updates the shared variables in the mission so that the DetectorHandler can access it, and also releases all DetectorHandlers.


createMotions

public List createMotions()
Creates a list of persistent Motion objects (in mission memory) from the current and previous aircraft positions in currentFrame and state. We note that though the returned list is allocated in per release memory, the Motion objects being elements of the list live in mission memory.


reduceAndPartitionMotions

public void reduceAndPartitionMotions(Reducer reducer,
                                      List motions)
Method to input a list of motions to a reducer to implement the reduction based on voxels hashing.

Parameters:
reducer - the object of reduction algorithm to perform voxel hashing and check the overlapping between motions and voxels.
motions - the motions to be checked.