This repository has been archived by the owner on Feb 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVertex.cpp
139 lines (113 loc) · 1.67 KB
/
Vertex.cpp
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#include "Vertex.h"
using namespace std;
Vertex::Vertex(GPSCoord c, int ID)
{
coords = c;
id = ID;
time = 0;
dist = 0;
}
/*
* Auxiliary function to add an outgoing edge to a vertex (this),
* with a given destination vertex (d) and edge weight (w).
*/
void Vertex::addEdge(Vertex *d, double w, Info i)
{
adj.push_back(Edge(d, w, i));
}
bool Vertex::operator<(Vertex & vertex) const
{
return this->dist < vertex.dist;
}
GPSCoord Vertex::getCoords() const
{
return this->coords;
}
double Vertex::getDist() const
{
return this->dist;
}
Vertex *Vertex::getPath() const
{
return this->path;
}
vector<Edge> Vertex::getAdj() const
{
return adj;
}
int Vertex::getId() const
{
return id;
}
int Vertex::getIndex() const
{
return queueIndex;
}
bool Vertex::isProcessing() const
{
return processing;
}
void Vertex::setDist(double d)
{
dist = d;
}
void Vertex::setPath(Vertex *v)
{
path = v;
}
void Vertex::setProcessing(bool p)
{
processing = p;
}
void Vertex::setIndex(int i)
{
queueIndex = i;
}
void Vertex::setTime(double t)
{
time = t;
}
double Vertex::getTime() const
{
return time;
}
double Vertex::getCost() const
{
return cost;
}
void Vertex::setCost(double c)
{
cost = c;
}
bool Vertex::isCounting() const
{
return counting;
}
void Vertex::setCounting(bool c)
{
counting = c;
}
void Vertex::setLimitReached(bool lr)
{
limitReached = lr;
}
bool Vertex::isLimitReached() const
{
return limitReached;
}
double Vertex::getTimeCount() const
{
return time_count;
}
void Vertex::setTimeCount(double tc)
{
time_count = tc;
}
bool Vertex::isConectedToTrain() const
{
return conectionToTrain;
}
void Vertex::setConectionToTrain(bool ct)
{
conectionToTrain = ct;
}