Trajectory Outlier Detection Library
 All Classes Functions Variables Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
CDistanceOutlier Class Reference

Handles partition outlier computation. More...

#include <DistanceOutlier.h>

Public Member Functions

 CDistanceOutlier (int nTrajectories, int nLineSegments, IntIntPairArray *idArray, FloatMatrix *distanceIndex)
 Constructor. More...
 
bool DetectOutlyingLineSegment (vector< bool > *result)
 Determines if any of the partitions are outlying or not. More...
 
void SetFractionParameter (float fraction)
 Setter for the fraction of trajectories that must be far to be called an outlier (in the paper, "p")
 
void SetDistanceParameter (float distance)
 Setter for the distance parameter D.
 
void SetLengthArray (FloatArray *lengthArray)
 Setter for the array of partition lengths.
 
void SetCloseTrajectoryPartition (map< IntIntPair, int > *indexMap, IntIntPairMatrix *partitionMatrix)
 Setter for mappings required for partition pruning optimization.
 
void SetFinePartitionLength (map< IntIntPair, float > *lengthMap)
 Setter for lengths of fine level partitions.
 
void SetCoarsePartitionId (map< IntIntPair, int > *idMap)
 Setter for mapping of coarse partition IDs.
 
void SetDensityFilePath (string filePath)
 Set file path for precomputed density file.
 

Public Attributes

TrajDatam_data
 

Private Member Functions

int GetNumOfNearTrajectories (int index)
 Returns the number of trajectories that are close to the line segment. More...
 
bool IsTrajectoryNear (int lineSegmentId, int trajectoryId)
 Returns whether a trajectory is near a line segment (partition) More...
 
void ConstructRangeOfTrajectory ()
 
void MeasureDensityOfLineSegment ()
 
float MeasureDistanceFromPointToPoint (CMDPoint *point1, CMDPoint *point2)
 

Private Attributes

int m_nTrajectories
 
int m_nLineSegments
 
IntIntPairArray * m_idArray
 
FloatMatrix * m_distanceIndex
 
FloatArray * m_lengthArray
 
float m_fractionParam
 
float m_distanceParam
 
int m_nNearTrajectories
 
IntIntPairArray m_trajectoryRange
 
FloatArray m_densityArray
 
string m_densityFilePath
 
map< IntIntPair, int > * m_closePartitionArrayIndexMap
 
IntIntPairMatrix * m_closePartitionArray
 
map< IntIntPair, float > * m_finePartitionLengthMap
 
map< IntIntPair, int > * m_coarsePartitionIdMap
 

Detailed Description

Handles partition outlier computation.

Used by OutlierDetector to handle the actual distance comparisions to find outlying partitions. The comparisions and finding of partition outliers are done here, while a lot of the management and higher-level functionality (finding and cataloging outlying trajectories, pruning optimization, etc.) are handled in COutlierDetector.

Constructor & Destructor Documentation

CDistanceOutlier::CDistanceOutlier ( int  nTrajectories,
int  nLineSegments,
IntIntPairArray *  idArray,
FloatMatrix *  distanceIndex 
)

Constructor.

Parameters
[in]nTrajectoriesthe number of trajectories in the dataset
[in]nLineSegmentsthe number of line segments (partitions) in the dataset
[in]idArrayan array that maps each partition (partition ID as the index of the array) to the ID of the trajectory it belongs to
[in]distanceIndexthe matrix of distances between partitions

Member Function Documentation

bool CDistanceOutlier::DetectOutlyingLineSegment ( vector< bool > *  result)

Determines if any of the partitions are outlying or not.

This method is the real workhorse behind the outlier detection - it performs the actual distance comparisions to check if a partition is an outlier or not.

Parameters
[out]resultflags for each partition denoting whether they are outlying or not
Returns
Successful or not.
int CDistanceOutlier::GetNumOfNearTrajectories ( int  index)
private

Returns the number of trajectories that are close to the line segment.

Parameters
[in]indexthe ID of the line segment (partition)
Returns
the number of close trajectories
bool CDistanceOutlier::IsTrajectoryNear ( int  lineSegmentId,
int  trajectoryId 
)
private

Returns whether a trajectory is near a line segment (partition)

Parameters
[in]lineSegmentIdthe ID of the partition
[in]trajectoryIdthe ID of the trajectory
Returns
true if the trajectory and partition are close, false if they are not

The documentation for this class was generated from the following files: