Class 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
    • 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 class AbsMatIndexer<ISTTrackingEvent>
      • 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 interface ISTTrackingEventIndexer
        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.