Package edu.gsu.cs.dmlab.indexes
Class BasicEventIndexer
- java.lang.Object
-
- edu.gsu.cs.dmlab.indexes.interfaces.AbsMatIndexer<ISTTrackingEvent>
-
- edu.gsu.cs.dmlab.indexes.BasicEventIndexer
-
- All Implemented Interfaces:
IIndexer<ISTTrackingEvent>
,ISTTrackingEventIndexer
public class BasicEventIndexer extends AbsMatIndexer<ISTTrackingEvent> implements ISTTrackingEventIndexer
This class provides event indexing for ISpatialTemporalObj objects. The indexing is based on a grid of Lists, where the grid represents the space over which the index is valid. The List in each location of the grid is used to sort the IEvent objects that intersect each spatial coordinate based on time. The class also provides a temporal index for the IEvent objects that are put into it. This index is meant to allow for the calculation of the expected change per "frame" or time step in reporting of events.- Author:
- Thaddeus Gholston, updated by Dustin Kempton Data Mining Lab, Georgia State University
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.gsu.cs.dmlab.indexes.interfaces.AbsMatIndexer
AbsMatIndexer.LockingArrayList<B>
-
-
Field Summary
-
Fields inherited from class edu.gsu.cs.dmlab.indexes.interfaces.AbsMatIndexer
objectList, regionDimension, regionDivisor, searchSpace
-
-
Constructor Summary
Constructors Constructor Description BasicEventIndexer(List<ISTTrackingEvent> regionalList, int regionDimension, int regionDiv, org.joda.time.Duration frameSpan, int numThreads)
Constructor, constructs a new BasicEventIndexer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildIndex()
The function that indexes the passed in objects.void
finalize()
int
getExpectedChangePerFrame(org.joda.time.Interval timePeriod)
Computes the expected change in the number of detections in each frame.EventType
getTypeIndexed()
Returns the event type that is indexed in this event indexer.-
Methods inherited from class edu.gsu.cs.dmlab.indexes.interfaces.AbsMatIndexer
getAll, getFirstTime, getLastTime, search
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.gsu.cs.dmlab.indexes.interfaces.IIndexer
getAll, getFirstTime, getLastTime, search
-
-
-
-
Constructor Detail
-
BasicEventIndexer
public BasicEventIndexer(List<ISTTrackingEvent> regionalList, int regionDimension, int regionDiv, org.joda.time.Duration frameSpan, int numThreads) throws IllegalArgumentException
Constructor, constructs a new BasicEventIndexer.- Parameters:
regionalList
- The list of IEvent objects to add to the index.regionDimension
- The length for both the x and y spatial domain. For example x will be valid for [0, regionDimension].regionDiv
- The divisor used to down size each of the IEvent objects to fit inside the spatial domain specified by the regionDimension parameter.frameSpan
- The length of a frame in the index. This is used to compute the expected change in detections per frame.numThreads
- The number of threads to use when processing batch. -1 for all available > 0 for a specific number. JavaEE doesn't seem to like more than one thread, so only use 1 for applications built for web application servers.- Throws:
IllegalArgumentException
- When any of the passed in arguments are null, or if the regionDimension is less than 1 same with divisor, or frame span.
-
-
Method Detail
-
buildIndex
protected void buildIndex()
Description copied from class:AbsMatIndexer
The function that indexes the passed in objects. Since each object is different in how it is indexed, this is implemented by each index implementation. This must be called before any spatial query will return the correct list of objects.- Specified by:
buildIndex
in classAbsMatIndexer<ISTTrackingEvent>
-
finalize
public void finalize() throws Throwable
- Overrides:
finalize
in classAbsMatIndexer<ISTTrackingEvent>
- Throws:
Throwable
-
getExpectedChangePerFrame
public int getExpectedChangePerFrame(org.joda.time.Interval timePeriod)
Description copied from interface:ISTTrackingEventIndexer
Computes the expected change in the number of detections in each frame. The length of the frame is set internally but the time that this expected change is to be computed over is passed in as a parameter.- Specified by:
getExpectedChangePerFrame
in interfaceISTTrackingEventIndexer
- Parameters:
timePeriod
- The period over which the expected change is to be computed.- Returns:
- The expected change in the number of detections per frame based on the passed in period of time.
-
getTypeIndexed
public EventType getTypeIndexed()
Description copied from interface:ISTTrackingEventIndexer
Returns the event type that is indexed in this event indexer.- Specified by:
getTypeIndexed
in interfaceISTTrackingEventIndexer
- Returns:
- Event type of the events in the indexer.
-
-