-
Notifications
You must be signed in to change notification settings - Fork 0
/
Edge.cpp
43 lines (34 loc) · 834 Bytes
/
Edge.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
//
// Created by manue on 03/04/2023.
//
#include "Edge.h"
Edge::Edge(Vertex *orig, Vertex *dest, unsigned capacity, Service service) : orig(orig), dest(dest), capacity(capacity),
service(service) {
if (service == STANDARD)
cost = 2;
else if (service == ALFA)
cost = 4;
else
cost = -1;
}
Vertex *Edge::getOrig() const {
return this->orig;
}
Vertex *Edge::getDest() const {
return this->dest;
}
unsigned Edge::getCapacity() const {
return this->capacity;
}
Edge::Service Edge::getService() const {
return this->service;
}
unsigned int Edge::getCost() const {
return this->cost;
}
unsigned Edge::getFlow() const {
return flow;
}
void Edge::setFlow(unsigned flow) {
this->flow = flow;
}