-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSimAllParllel_modified.m
33 lines (22 loc) · 1008 Bytes
/
SimAllParllel_modified.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
clear all
clc
%matlabpool open
for indexprobSUChanAcc= 2:9
numIterations = 2;
numberOfSUs = 20; % change in other files too
SUAccessProb = 0.1*indexprobSUChanAcc;
interferenceVec = zeros(numIterations,2);
controlSlotsVec = zeros(numIterations,2);
throughPutVec = zeros(numIterations,2);
SUUsingSameChanVec = zeros(numIterations,2);
for algorithm = 1:2
multiUserSim =[];
parfor iteration = 1:numIterations
multiUserSim = [multiUserSim, multiUserPredictiveChannelUse(algorithm, SUAccessProb)];
end
for i = 1:numIterations
[interferenceVec(i,algorithm),throughPutVec(i,algorithm) ,controlSlotsVec(i,algorithm),SUUsingSameChanVec(i,algorithm) ] = multiUserSim(1,i).audit(numberOfSUs);
end
end
save(strcat('MAP',num2str(SUAccessProb),'pm_Utilization.mat'),'interferenceVec','controlSlotsVec','throughPutVec','SUUsingSameChanVec');
end