-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNode.h
45 lines (40 loc) · 1.23 KB
/
Node.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
#pragma once
#include "Route.h"
#include "SeqData.h"
#include <vector>
using namespace std;
class Route;
class Node{
public:
bool isDepot;
int posInRoute;
int posInSol;
Route* rou;
Node* pred;
Node* suc;
SeqData* seq0_i;
SeqData* seqi_0;
SeqData* seqi_n;
SeqData* seqn_i;
vector <SeqData*> seqi_j; // data for (i,j) with j > i
vector <SeqData*> seqj_i; // data for (j,i) (for the same subsequence as i_j, but reversed)
int demand;
vector<int> movesClu; //init based on correlation measure for cluster
vector<int> movesLoc; //init based on correlation measure for locations (still contain the index of customer)
vector<bool> idxLocMoves; //true if index of customer is in the movesLoc (false if not exist).
vector<bool> idxCluMoves; //true if index of customer is in the movesClu (false if not exist).
int idxClient = -1;
int idxLoc = -1;
Node() {
isDepot = false;
rou = nullptr;
}
bool ckNearDepot() {
return (pred->idxClient == 0 || suc->idxClient == 0);
}
~Node() {
movesClu.clear();
movesLoc.clear();
idxLocMoves.clear();
};
};