Mercurial > hg > nsaunier > traffic-intelligence
comparison trajectorymanagement/src/Metric.h @ 1159:e1e7acef8eab
moved trajectory management library into Traffic Intelligence
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 22 Feb 2021 22:09:35 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1158:7eb972942f22 | 1159:e1e7acef8eab |
|---|---|
| 1 #ifndef METRIC_H_ | |
| 2 #define METRIC_H_ | |
| 3 | |
| 4 #include "Trajectory.h" | |
| 5 | |
| 6 /** | |
| 7 * Metric class. | |
| 8 * | |
| 9 * The Metric class is an abstract class. Every class computing similarity between two trajectories should inherit this class. | |
| 10 */ | |
| 11 template<typename Tr, typename To> | |
| 12 class Metric | |
| 13 { | |
| 14 public: | |
| 15 /** | |
| 16 * Compute similarity between two trajectories. | |
| 17 * | |
| 18 * @param[in] a input trajectory | |
| 19 * @param[in] b input trajectory | |
| 20 * @param[out] result similarity between two trajectories | |
| 21 */ | |
| 22 virtual void similarity(const Trajectory<Tr> *a, const Trajectory<Tr> *b, To &result) { | |
| 23 result = To(0); | |
| 24 } | |
| 25 | |
| 26 /** | |
| 27 * Compute distance (or normalized distance) between two trajectories. | |
| 28 * | |
| 29 * @param[in] a input trajectory | |
| 30 * @param[in] b input trajectory | |
| 31 * @param[in] nbOfPoints is the limit to which the distance of trajectories is calculated. This is useful in the event of different sizes. | |
| 32 * @param[out] result distance between two trajectories | |
| 33 */ | |
| 34 virtual void distance(const Trajectory<Tr> *a, const Trajectory<Tr> *b, To &result, unsigned int nbOfPoints = std::numeric_limits<unsigned int>::max()) = 0; | |
| 35 | |
| 36 | |
| 37 | |
| 38 }; | |
| 39 | |
| 40 #endif /* METRIC_H_ */ |
