forked from woodbri/vrpdptw
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRoute.h
68 lines (46 loc) · 1.35 KB
/
Route.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef ROUTE_H
#define ROUTE_H
#include <stdexcept>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <math.h>
class Solution; // forward reference
#include "Order.h"
#include "Problem.h"
class Route {
public:
int rid;
Problem& P;
std::vector<int> path; // node ids along the path
std::vector<int> orders; // order ids associated with the nodes
// std::vector<int> capacity; // capacity after node is loaded
// std::vector<double> pdist; // distance at node max(arrival time, tw_open)
bool updated;
int D; // duration
int TWV; // TW violations
int CV; // capacity violations
double cost;
// these are used by testPath()
int tD; // duration
int tTWV; // TW violations
int tCV; // capacity violations
Route(Problem& p);
// ~Route() {};
Route &operator = (const Route &r) { P = r.P; return *this; };
void update();
double testPath(const std::vector<int>& tp);
double getCost();
void addOrder(const Order &o);
bool insertOrder(int oid, bool mustBeValid);
void removeOrder(const Order &o);
void removeOrder(const int oid);
int addPickup(const Order &o);
void addDelivery(const Order &o);
void hillClimbOpt();
void dump();
};
#endif