-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataForLinearRegression.m
71 lines (57 loc) · 2.33 KB
/
dataForLinearRegression.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
% Script to obtain data for multiple linear regression
% Creo diferentes estructuras y varío el número de estaciones pico activas,
% tráfico, ABS y CRE para obtener datos.
% Los datos obtenidos los guardo directamente en la carpeta de regresion
% lineal como dataConsumption.mat
%debug
clc,clear all, close all
nStructs = 5;
display('Calculating data...')
[stat,path] = fileattrib;
pathCurrent = path.Name;
pathFolder = [pathCurrent '\regresion lineal'];
ISD = 500; % Inter-Site Distance between BSs
r = ISD/3;
apothem = sqrt(3)/2 * r;
nMaxUE = 100; % Maximum number of UE associated to a (macro or pico) BS.
plotting = 0; % Activation of graphs
t = [0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 65];
ABSvalues = 1:7;
CREvalues = [0 6 9 12 18];
armsValues = [];
for i=1:length(ABSvalues)
aux = [repmat(ABSvalues(i),length(CREvalues),1) CREvalues'];
armsValues = [armsValues; aux];
end
dataConsumptionMacroBlockade = [];
dataConsumptionPico = [];
nPicos = 12; % Number of picos per sector
matrixStates = zeros(nPicos+1, nPicos);
for i=2:size(matrixStates,1)
aux = ones(1,i-1);
aux2 = zeros(1,nPicos - (i-1));
matrixStates (i,:)=[aux2 aux];
end
for index=1:nStructs
display(index);
[scheme, macroPositions, simulatedSectorCenters] = inicialization(ISD, nPicos, nMaxUE, plotting);
[scheme] = picoCellGeneration(apothem, nPicos, simulatedSectorCenters, macroPositions, scheme, plotting);
scheme.nPicos = nPicos;
scheme.simulatedSectorCenters = simulatedSectorCenters;
scheme.macroPositions = macroPositions;
save('schemeData','scheme','simulatedSectorCenters','macroPositions');
for i=1:size(matrixStates,1)
X = matrixStates(i,:);
for j=1:length(t)
for k=1:length(armsValues)
nABSsubframes = armsValues(k,1);
CRE = armsValues(k,2);
[returnDataMacroBlockade, returnDataPico] = consumptionData(X, t(j), nABSsubframes, CRE);
dataConsumptionMacroBlockade = [dataConsumptionMacroBlockade; returnDataMacroBlockade];
dataConsumptionPico = [dataConsumptionPico; returnDataPico];
end
end
end
end
save([pathFolder '\dataConsumption.mat'],'dataConsumptionMacroBlockade','dataConsumptionPico');
display('Stored Data.')