2018-06-09 15:14:08 +00:00
|
|
|
// Copyright 2018, University of Freiburg,
|
|
|
|
// Chair of Algorithms and Data Structures.
|
|
|
|
// Authors: Patrick Brosi <brosi@informatik.uni-freiburg.de>
|
|
|
|
|
|
|
|
#ifndef PFAEDLE_EVAL_RESULT_H_
|
|
|
|
#define PFAEDLE_EVAL_RESULT_H_
|
|
|
|
|
2019-01-10 15:52:59 +00:00
|
|
|
#include "pfaedle/gtfs/Feed.h"
|
2018-06-09 15:14:08 +00:00
|
|
|
#include "ad/cppgtfs/gtfs/Feed.h"
|
|
|
|
|
2019-01-10 15:52:59 +00:00
|
|
|
using pfaedle::gtfs::Trip;
|
2018-06-09 15:14:08 +00:00
|
|
|
using ad::cppgtfs::gtfs::Shape;
|
|
|
|
|
|
|
|
namespace pfaedle {
|
|
|
|
namespace eval {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A single evaluation result.
|
|
|
|
*/
|
|
|
|
class Result {
|
|
|
|
public:
|
|
|
|
Result(const Trip* t, double dist) : _t(t), _dist(dist) {}
|
|
|
|
|
|
|
|
double getDist() const { return _dist; }
|
|
|
|
const Trip* getTrip() const { return _t; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
const Trip* _t;
|
|
|
|
double _dist;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline bool operator<(const Result& lhs, const Result& rhs) {
|
|
|
|
return lhs.getDist() < rhs.getDist() ||
|
|
|
|
(lhs.getDist() == rhs.getDist() && lhs.getTrip() < rhs.getTrip());
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace eval
|
|
|
|
} // namespace pfaedle
|
|
|
|
|
|
|
|
#endif // PFAEDLE_EVAL_RESULT_H_
|