generate-shapes/src/pfaedle/eval/Result.h

41 lines
900 B
C
Raw Normal View History

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_
#include "pfaedle/gtfs/Feed.h"
2018-06-09 15:14:08 +00:00
#include "ad/cppgtfs/gtfs/Feed.h"
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_