-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstance_util.h
47 lines (39 loc) · 1.11 KB
/
instance_util.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
#ifndef INSTANCE_UTIL_H
#define INSTANCE_UTIL_H
#include <iostream>
#include <map>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#define TARGET_DIRECTORY "./instances/"
#define DEBUG(x) cout << #x << " = " << x << endl
class Node {
public:
int nodeID; // id for solution route
double longitude; // node latitude
double latitude; // node longitude
char nodeType; // d=depot, f=AFS, c=customer
Node();
void setNodeData(int id, char t, double lon, double lat);
~Node();
};
class Instance {
public:
std::string name; // instance name
std::string dir; // instance directory
int maxTime; // time limit
int maxDistance; // distance limit
int numCustomers; // number of customs
int numStations; // numbor of AFS
int refuelTime; // time it takes to refuel
int serviceTime; // time it takes to serve a client
double speed; // travelling speed
std::vector<Node> customerNodes;
std::vector<Node> fuelNodes;
Node depot;
int loadData();
Instance(std::string iName);
~Instance();
};
#endif