Mercurial Hosting > traffic-intelligence
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trajectorymanagement/src/Metric.h Mon Feb 22 22:09:35 2021 -0500 @@ -0,0 +1,40 @@ +#ifndef METRIC_H_ +#define METRIC_H_ + +#include "Trajectory.h" + +/** + * Metric class. + * + * The Metric class is an abstract class. Every class computing similarity between two trajectories should inherit this class. + */ +template<typename Tr, typename To> +class Metric +{ +public: + /** + * Compute similarity between two trajectories. + * + * @param[in] a input trajectory + * @param[in] b input trajectory + * @param[out] result similarity between two trajectories + */ + virtual void similarity(const Trajectory<Tr> *a, const Trajectory<Tr> *b, To &result) { + result = To(0); + } + + /** + * Compute distance (or normalized distance) between two trajectories. + * + * @param[in] a input trajectory + * @param[in] b input trajectory + * @param[in] nbOfPoints is the limit to which the distance of trajectories is calculated. This is useful in the event of different sizes. + * @param[out] result distance between two trajectories + */ + virtual void distance(const Trajectory<Tr> *a, const Trajectory<Tr> *b, To &result, unsigned int nbOfPoints = std::numeric_limits<unsigned int>::max()) = 0; + + + +}; + +#endif /* METRIC_H_ */