Trajectory Outlier Detection Library
 All Classes Functions Variables Pages
Trajectory.h
1 #pragma once
2 
3 // CTrajectory command target
4 
5 #include <vector>
6 #include "MDPoint.h"
7 
8 #include <set>
9 using namespace std;
10 
11 
12 // this structure contains the information required to derive the lower and upper bounds
16 typedef struct PartitionInfo {
17  float maxPerpDist;
18  float minLength;
19  float maxLength;
20  float maxTheta;
22 
29 {
30 friend class COutlierDetector;
31 friend class CDistanceOutlier;
32 public:
33  CTrajectory();
34  CTrajectory(int id, int nDimensions);
35  virtual ~CTrajectory();
36 private:
37  int m_trajectoryId; // the identifier of this trajectory
38  int m_nDimensions; // the dimensionality of this trajectory
39  int m_nPoints; // the number of points constituting a trajectory
40  vector <CMDPoint> m_pointArray; // the array of the trajectory points
41  int m_nPartitionPoints; // the number of partition points in a trajectory
42  vector <CMDPoint> m_partitionPointArray; // the array of the partition points
43  vector <int> m_partitionIndexArray; // the array of the partition indexes
44  vector <PartitionInfo> m_partitionInfoArray; // the array of the partition information
45  float m_totalPartitionLength; // the total length of all trajectory partitions
46  float m_outlyingPartitionLength; // the total length of all outlying partitions
47  int m_nOutlyingPartitions; // the number of outlying trajectory partitions
48  vector <int> m_outlyingPartitionArray; // the array of the indexes of outlying partitions
49  int m_nPenWidth; // the width of the pen for drawing a trajectory
50  bool m_containOutlier; // true if this trajectory contains an outlier; false otherwise
51 public:
52  void SetId(int id) { m_trajectoryId = id; }
53  const int GetId() const { return m_trajectoryId; }
54  void AddPointToArray(CMDPoint point) { m_pointArray.push_back(point); m_nPoints++; }
55  void AddPartitionPointToArray(CMDPoint point, int index) {
56  m_partitionPointArray.push_back(point);
57  m_partitionIndexArray.push_back(index);
58  m_nPartitionPoints++;
59  }
60  void StorePartitionInfo(PartitionInfo info) { m_partitionInfoArray.push_back(info); }
62  void SetLength(float length) { m_totalPartitionLength = length; }
64  const float GetLength() const { return m_totalPartitionLength; }
66  void SetOutlyingLength(float length) { m_outlyingPartitionLength = length; }
68  const float GetOutlyingLength() const { return m_outlyingPartitionLength; }
70  const int GetNumOutlyingPartition() const { return m_nOutlyingPartitions; }
72  const vector<CMDPoint> GetPointArray() const { return m_pointArray; }
74  const vector <CMDPoint> GetPartitionPointArray() const { return m_partitionPointArray; }
76  void AddOutlyingPartition(int index) { m_outlyingPartitionArray.push_back(index); m_nOutlyingPartitions++; }
78 
79  pair<CMDPoint*,CMDPoint*> GetOutlyingPartition(int nth);
80 
81 };
A simple point class.
Definition: MDPoint.h:10
const vector< CMDPoint > GetPartitionPointArray() const
Getter for partition point array.
Definition: Trajectory.h:74
void AddPartitionPointToArray(CMDPoint point, int index)
Add a point to the array of partition points.
Definition: Trajectory.h:55
const float GetOutlyingLength() const
Getter for outlying partition length.
Definition: Trajectory.h:68
const int GetId() const
Return the trajectory id of this trajectory.
Definition: Trajectory.h:53
Information required to derive the lower and upper bounds for optimized partition pruning...
Definition: Trajectory.h:16
A high-level class to perform the outlier detection.
Definition: OutlierDetector.h:26
void SetLength(float length)
Setter for total partition length.
Definition: Trajectory.h:62
The main storage for information about a trajectory.
Definition: Trajectory.h:28
void SetOutlyingLength(float length)
Setter for outlying partition length.
Definition: Trajectory.h:66
const int GetNumOutlyingPartition() const
Getter for number of outlying partitions.
Definition: Trajectory.h:70
void AddOutlyingPartition(int index)
Add an outlying partition to the array of outlying partitions.
Definition: Trajectory.h:76
void AddPointToArray(CMDPoint point)
Add a CMDPoint point to the array of trajectory points.
Definition: Trajectory.h:54
Handles partition outlier computation.
Definition: DistanceOutlier.h:33
void StorePartitionInfo(PartitionInfo info)
Add the PartitionInfo object info to the array of partition information.
Definition: Trajectory.h:60
const float GetLength() const
Getter for total partition length.
Definition: Trajectory.h:64
const vector< CMDPoint > GetPointArray() const
Getter for trajectory point array.
Definition: Trajectory.h:72
void SetId(int id)
Set the trajectory id of this trajectory.
Definition: Trajectory.h:52