-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptimalWSC_NOP.m
20 lines (18 loc) · 1003 Bytes
/
optimalWSC_NOP.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function [WSC_Max, Ang_Max, DeltaComp_Max] = optimalWSC_NOP(A, E, Rj, hj, dAB, gammaA, gammaJ, channelParam, thetaV, nUAV, typeA )
% Performs exhaustive search of WSC over available actions (opening angles)
% and returns the WSC, angle and Delta distribution corresponding to it for
% the no precoding case
WSC_Max = 0; % Initialize WSC
Ang_Max = 0; % Initialize angle
DeltaComp_Max = 0; % Initialize Delta distribution
for ang=thetaV % Iterate over the available angles (action space search)
UAVs = setNewPos_N(nUAV, ang, hj, Rj, typeA); % Position UAV in corresponding positions
[WSC_Dum, DeltaComp] = computeWSC_NOP_NUAV(A, E, UAVs, dAB, gammaA, gammaJ, channelParam ); % Compute WSC
% If WSC is better than current best WSC, update
if WSC_Dum > WSC_Max
WSC_Max = WSC_Dum;
Ang_Max = ang;
DeltaComp_Max = DeltaComp;
end
end
end