-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclasses.cpp
More file actions
68 lines (62 loc) · 1006 Bytes
/
classes.cpp
File metadata and controls
68 lines (62 loc) · 1006 Bytes
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
#include "classes.h"
Link::Link(int s, int d, bool iswireless, double ratio)
{
src = s;
dst = d;
weight = 0.0;
flowNumThrIt = 0;
averageBandwidth = 0;
isWireless = iswireless;
isAvailable = true;
totalRate.clear();
intfLinks.clear();
inNeighborLinks.clear();
if (isWireless == false)
{
totalBandwidth = unusedBandwidth = WIRED_BW;
}
else
{
totalBandwidth = unusedBandwidth = WIRELESS_BW * ratio;
}
}
Path::Path()
{
len = 0;
weight = 0.0;
isHybrid = false;
isSelectedPath = false;
links.clear();
}
MultiPath::MultiPath()
{
pathNumber = 0;
isAvailable = false;
paths.clear();
}
Flow::Flow(int s, int d, double size, int arr)
{
id = -1;
src = s;
dst = d;
prepath = NULL;
pathNumber = 0;
arrivalTime = arr;
totalSize = currentSize = size;
if (size > THRESHOLD_LARGE_FLOW)
{
isLargeFlow = true;
}
else
{
isLargeFlow = false;
}
rate = 0;
isFirstVisted = true;
isSlowStart = true;
}
IndependentSet::IndependentSet()
{
linkSet.clear();
isSelected = false;
}