-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRouteSet.h
44 lines (35 loc) · 882 Bytes
/
RouteSet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <memory>
#include <vector>
#include <Route.h>
using namespace std;
class RouteSet {
public:
vector<shared_ptr<Route>> routes;
float TOTFIT = -1;
float d0, d1, d2, dun, ATT;
bool operator <(const RouteSet& rs) {
if (TOTFIT < 0 || rs.TOTFIT < 0) {
LOGF << "Comparision without TOTFIT";
exit(0);
} // Check speed without this
return TOTFIT < rs.TOTFIT;
}
void add_route(shared_ptr<Route> route) {
routes.push_back(route);
}
void print() {
cout << "*" << TOTFIT << "* ";
for(auto route: routes) {
route->print();
cout << '|';
}
cout << endl;
}
RouteSet() = default;
RouteSet(const shared_ptr<RouteSet> route_set) {
routes = route_set->routes;
}
void EVAL() {
TOTFIT = rand()%50;
}
};