-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEdge.cpp
More file actions
46 lines (35 loc) · 1.12 KB
/
Edge.cpp
File metadata and controls
46 lines (35 loc) · 1.12 KB
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
#include "Edge.hpp"
Edge::Edge( int start_node , int end_node , double distance , double speed_limit ) {
this->start_node = start_node;
this->end_node = end_node;
this->distance = distance;
this->speed_limit = speed_limit;
this->adjustment_factor = 1;
this->weight = (this->distance) / (this->speed_limit);
}
Edge::~Edge() {
}
int Edge::get_start_node() {
return this->start_node;
}
int Edge::get_end_node() {
return this->end_node;
}
double Edge::get_weight() {
return this->weight;
}
double Edge::get_adjustment_factor() {
return this->adjustment_factor;
}
void Edge::set_adjustment_factor( double adjustment_factor ) {
this->adjustment_factor = adjustment_factor;
this->weight = (this->distance) / (this->speed_limit * this->adjustment_factor);
}
void Edge::set_distance( double distance ) {
this->distance = distance;
this->weight = (this->distance) / (this->speed_limit * this->adjustment_factor);
}
void Edge::set_speed_limit( double speed_limit ) {
this->speed_limit = speed_limit;
this->weight = (this->distance) / (this->speed_limit * this->adjustment_factor);
}