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

40 lines
873 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 "ad/cppgtfs/gtfs/Feed.h"
using ad::cppgtfs::gtfs::Trip;
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_