-
Notifications
You must be signed in to change notification settings - Fork 3
/
Zonas.m
130 lines (124 loc) · 9.45 KB
/
Zonas.m
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
classdef Zonas
properties
Continentes;
ContinentesHosts;
DensidadeUsuarios;
DensidadeHosts;
LatLong;
MatrizTrafego;
Fluxo;
AtividadeHora;
ZonaId;
end
methods
% construtor
function obj = Zonas()
% obj.ContinentesHosts = [71871.5 17698 7686.4 1474.8 241.9 1873.65].*1000; %2001
% obj.ContinentesHosts = [345660847,704833752,2187667453,437001277,453329534,28439277].*1000; % 2017
%% Distribuição dos Terminais de Usuário por Continente - 2020
obj.ContinentesHosts = [436745577, 727848547, 2525033874, 371127426, 566138772, 28917600].*1000; % 2020
% América do Norte - 436.745.577; Europa - 727.848.547; Ásia - 2.525.033.874; America do Sul - 371.127.426
% África - 566.138.772; Oceania/Austrália - 28.917.600
obj.Continentes = [
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3
1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 6
4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 6
4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 6
4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 6
4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 6
4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 6
];
obj.DensidadeUsuarios = [
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 32 16 16 16 16 16 0 1.6 1.6 1.6 1.6 16 32 16 6.4 6.4 16 16 16 16 16 16 6.4
0 16 6.4 32 95 95 95 95 6.4 1.6 1.6 191 239 95 95 95 95 95 32 32 32 0 0 0
1.6 0 1.6 16 239 95 32 6.4 1.6 1.6 1.6 318 318 318 32 239 191 191 239 239 95 95 1.6 1.6
0 1.6 0 0 16 95 16 1.6 0 0 0 191 191 191 239 239 239 239 239 191 1.6 0 0 0
0 0 0 0 0 0 16 95 16 0 0 16 95 16 32 6.4 1.6 32 191 95 95 0 0 0
0 0 0 0 0 0 16 191 239 95 0 0 6.4 32 95 0 0 0 0 32 32 191 0 0
0 0 0 0 0 0 0 95 95 32 0 0 6.4 191 16 6.4 0 0 0 16 32 32 6.4 0
0 0 0 0 0 0 0 191 6.4 0 0 0 0 16 0 0 0 0 0 0 6.4 16 0 0
0 0 0 0 0 0 0 6.4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
].*1000000;
% densidade de hosts
obj.DensidadeHosts = zeros(size(obj.DensidadeUsuarios));
for c = 1 : max(obj.Continentes(:))
obj.DensidadeHosts(find(obj.Continentes == c)) = (obj.DensidadeUsuarios(find(obj.Continentes == c))...
./sum(obj.DensidadeUsuarios(find(obj.Continentes == c)))).*obj.ContinentesHosts(c);
end
obj.LatLong = {
[82.5 -172.5] [82.5 -157.5] [82.5 -142.5] [82.5 -127.5] [82.5 -112.5] [82.5 -97.5] [82.5 -82.5] [82.5 -67.5] [82.5 -52.5] [82.5 -37.5] [82.5 -22.5] [82.5 -7.50] [82.5 7.50] [82.5 22.5] [82.5 37.5] [82.5 52.5] [82.5 67.5] [82.5 82.5] [82.5 97.5] [82.5 112.5] [82.5 127.5] [82.5 142.5] [82.5 157.5] [82.5 172.5];
[67.5 -172.5] [67.5 -157.5] [67.5 -142.5] [67.5 -127.5] [67.5 -112.5] [67.5 -97.5] [67.5 -82.5] [67.5 -67.5] [67.5 -52.5] [67.5 -37.5] [67.5 -22.5] [67.5 -7.50] [67.5 7.50] [67.5 22.5] [67.5 37.5] [67.5 52.5] [67.5 67.5] [67.5 82.5] [67.5 97.5] [67.5 112.5] [67.5 127.5] [67.5 142.5] [67.5 157.5] [67.5 172.5];
[52.5 -172.5] [52.5 -157.5] [52.5 -142.5] [52.5 -127.5] [52.5 -112.5] [52.5 -97.5] [52.5 -82.5] [52.5 -67.5] [52.5 -52.5] [52.5 -37.5] [52.5 -22.5] [52.5 -7.50] [52.5 7.50] [52.5 22.5] [52.5 37.5] [52.5 52.5] [52.5 67.5] [52.5 82.5] [52.5 97.5] [52.5 112.5] [52.5 127.5] [52.5 142.5] [52.5 157.5] [52.5 172.5];
[37.5 -172.5] [37.5 -157.5] [37.5 -142.5] [37.5 -127.5] [37.5 -112.5] [37.5 -97.5] [37.5 -82.5] [37.5 -67.5] [37.5 -52.5] [37.5 -37.5] [37.5 -22.5] [37.5 -7.50] [37.5 7.50] [37.5 22.5] [37.5 37.5] [37.5 52.5] [37.5 67.5] [37.5 82.5] [37.5 97.5] [37.5 112.5] [37.5 127.5] [37.5 142.5] [37.5 157.5] [37.5 172.5];
[22.5 -172.5] [22.5 -157.5] [22.5 -142.5] [22.5 -127.5] [22.5 -112.5] [22.5 -97.5] [22.5 -82.5] [22.5 -67.5] [22.5 -52.5] [22.5 -37.5] [22.5 -22.5] [22.5 -7.50] [22.5 7.50] [22.5 22.5] [22.5 37.5] [22.5 52.5] [22.5 67.5] [22.5 82.5] [22.5 97.5] [22.5 112.5] [22.5 127.5] [22.5 142.5] [22.5 157.5] [22.5 172.5];
[7.50 -172.5] [7.50 -157.5] [7.50 -142.5] [7.50 -127.5] [7.50 -112.5] [7.50 -97.5] [7.50 -82.5] [7.50 -67.5] [7.50 -52.5] [7.50 -37.5] [7.50 -22.5] [7.50 -7.50] [7.50 7.50] [7.50 22.5] [7.50 37.5] [7.50 52.5] [7.50 67.5] [7.50 82.5] [7.50 97.5] [7.50 112.5] [7.50 127.5] [7.50 142.5] [7.50 157.5] [7.50 172.5];
[-7.50 -172.5] [-7.50 -157.5] [-7.50 -142.5] [-7.50 -127.5] [-7.50 -112.5] [-7.50 -97.5] [-7.50 -82.5] [-7.50 -67.5] [-7.50 -52.5] [-7.50 -37.5] [-7.50 -22.5] [-7.50 -7.50] [-7.50 7.50] [-7.50 22.5] [-7.50 37.5] [-7.50 52.5] [-7.50 67.5] [-7.50 82.5] [-7.50 97.5] [-7.50 112.5] [-7.50 127.5] [-7.50 142.5] [-7.50 157.5] [-7.50 172.5];
[-22.5 -172.5] [-22.5 -157.5] [-22.5 -142.5] [-22.5 -127.5] [-22.5 -112.5] [-22.5 -97.5] [-22.5 -82.5] [-22.5 -67.5] [-22.5 -52.5] [-22.5 -37.5] [-22.5 -22.5] [-22.5 -7.50] [-22.5 7.50] [-22.5 22.5] [-22.5 37.5] [-22.5 52.5] [-22.5 67.5] [-22.5 82.5] [-22.5 97.5] [-22.5 112.5] [-22.5 127.5] [-22.5 142.5] [-22.5 157.5] [-22.5 172.5];
[-37.5 -172.5] [-37.5 -157.5] [-37.5 -142.5] [-37.5 -127.5] [-37.5 -112.5] [-37.5 -97.5] [-37.5 -82.5] [-37.5 -67.5] [-37.5 -52.5] [-37.5 -37.5] [-37.5 -22.5] [-37.5 -7.50] [-37.5 7.50] [-37.5 22.5] [-37.5 37.5] [-37.5 52.5] [-37.5 67.5] [-37.5 82.5] [-37.5 97.5] [-37.5 112.5] [-37.5 127.5] [-37.5 142.5] [-37.5 157.5] [-37.5 172.5];
[-52.5 -172.5] [-52.5 -157.5] [-52.5 -142.5] [-52.5 -127.5] [-52.5 -112.5] [-52.5 -97.5] [-52.5 -82.5] [-52.5 -67.5] [-52.5 -52.5] [-52.5 -37.5] [-52.5 -22.5] [-52.5 -7.50] [-52.5 7.50] [-52.5 22.5] [-52.5 37.5] [-52.5 52.5] [-52.5 67.5] [-52.5 82.5] [-52.5 97.5] [-52.5 112.5] [-52.5 127.5] [-52.5 142.5] [-52.5 157.5] [-52.5 172.5];
[-67.5 -172.5] [-67.5 -157.5] [-67.5 -142.5] [-67.5 -127.5] [-67.5 -112.5] [-67.5 -97.5] [-67.5 -82.5] [-67.5 -67.5] [-67.5 -52.5] [-67.5 -37.5] [-67.5 -22.5] [-67.5 -7.50] [-67.5 7.50] [-67.5 22.5] [-67.5 37.5] [-67.5 52.5] [-67.5 67.5] [-67.5 82.5] [-67.5 97.5] [-67.5 112.5] [-67.5 127.5] [-67.5 142.5] [-67.5 157.5] [-67.5 172.5];
[-82.5 -172.5] [-82.5 -157.5] [-82.5 -142.5] [-82.5 -127.5] [-82.5 -112.5] [-82.5 -97.5] [-82.5 -82.5] [-82.5 -67.5] [-82.5 -52.5] [-82.5 -37.5] [-82.5 -22.5] [-82.5 -7.50] [-82.5 7.50] [-82.5 22.5] [-82.5 37.5] [-82.5 52.5] [-82.5 67.5] [-82.5 82.5] [-82.5 97.5] [-82.5 112.5] [-82.5 127.5] [-82.5 142.5] [-82.5 157.5] [-82.5 172.5];
};
% fulxo entre continentes
Fluxo = zeros(max(obj.Continentes(:)));
% id das zonas com tráfego
obj.ZonaId = find(obj.DensidadeHosts > 0);
% requisitos de tráfego entre as zonas
totalZonas = size(obj.ZonaId,1);
obj.MatrizTrafego = zeros(totalZonas);
for i=1:totalZonas
for j=1:totalZonas
if i ~= j
obj.MatrizTrafego(i,j) = (((obj.DensidadeUsuarios(obj.ZonaId(i)))...
.*(obj.DensidadeHosts(obj.ZonaId(j)))).^ 0.5)./...
(((distance(obj.LatLong{obj.ZonaId(i)},obj.LatLong{obj.ZonaId(j)})))^1.5);
%continente de origem
CkOrg = obj.Continentes(obj.ZonaId(i));
%continente de destino
CkDst = obj.Continentes(obj.ZonaId(j));
Fluxo(CkOrg,CkDst) = Fluxo(CkOrg,CkDst)+obj.MatrizTrafego(i,j);
end
end
end
% fluxo entre continentes
obj.Fluxo = zeros(max(obj.Continentes(:)));
for k = 1 : max(obj.Continentes(:))
obj.Fluxo(k,:) = Fluxo(k,:)/sum(Fluxo(k,:));
end
% atividade dos usuários por hora
obj.AtividadeHora =[0.5 0.5 0.5 0.5 0.5 1 3.1 3.5 8.5 10.6 10.5 9.5 7.6 6.5 7.5 8.1 7 4.5 2.5 2 1.5 1 1.1 1];
end
function obj = set.Continentes(obj,val)
obj.Continentes = val;
end
function obj = set.ContinentesHosts(obj,val)
obj.ContinentesHosts = val;
end
function obj = set.DensidadeUsuarios(obj,val)
obj.DensidadeUsuarios = val;
end
function obj = set.DensidadeHosts(obj,val)
obj.DensidadeHosts = val;
end
function obj = set.LatLong(obj,val)
obj.LatLong = val;
end
function obj = set.MatrizTrafego(obj,val)
obj.MatrizTrafego = val;
end
function obj = set.Fluxo(obj,val)
obj.Fluxo = val;
end
function obj = set.ZonaId(obj,val)
obj.ZonaId = val;
end
end
end