-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEdge.cpp
More file actions
72 lines (49 loc) · 1.44 KB
/
Edge.cpp
File metadata and controls
72 lines (49 loc) · 1.44 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
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
#include "Edge.h"
Edge::Edge() {
time_stamp_ = 0.0 ;
key_node_ = 0 ;
rating_ = 11 ;
isOutgoing_ = false ;
}
Edge::Edge(unsigned key_node , int rating , double time_stamp,bool isOutgoing) {
key_node_ = key_node ;
rating_ = rating ;
time_stamp_ = time_stamp ;
isOutgoing_ = isOutgoing ;
}
Edge::Edge(const Edge & other) {
time_stamp_ = other.time_stamp_ ;
key_node_ = other.key_node_ ;
rating_ = other.rating_ ;
isOutgoing_ = other.isOutgoing_ ;
}
double Edge::getTimeStamp() {
return time_stamp_ ;
}
void Edge::setTimeStamp(double stamp) {
time_stamp_ = stamp ;
}
unsigned Edge::getKeyNode() {
return key_node_ ;
}
void Edge::setKeyNode(unsigned node_index) {
key_node_ = node_index ;
}
int Edge::getRating() {
return rating_ ;
}
void Edge::setRating(int rating) {
rating_ = rating ;
}
bool Edge::getEdgeType() {
return isOutgoing_ ;
}
void Edge::setEdgeType(bool type) {
isOutgoing_ = type ;
}
bool Edge::operator==(Edge & other) {
return time_stamp_ == other.time_stamp_ && rating_ == other.rating_ && key_node_ == other.key_node_ && isOutgoing_ == other.isOutgoing_ ;
}
bool Edge::operator!=(Edge & other) {
return time_stamp_ != other.time_stamp_ || rating_ != other.rating_ || key_node_ != other.key_node_ || isOutgoing_ != other.isOutgoing_ ;
}