-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattenuate.m
More file actions
50 lines (41 loc) · 1.24 KB
/
Copy pathattenuate.m
File metadata and controls
50 lines (41 loc) · 1.24 KB
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
%% ATTENUATE
% Calculates and applies directional attenuation
% to the coverage ranges of the given sources.
%
% Examples:
%
% Use OPTIM_NODE_CONFIG or STRETCH_CHAINLINK as the entry point.
%
% See also OPTIM_NODE_CONFIG, STRETCH_CHAINLINK, CHAINLINK, NODE_CONFIG_VOL
%
% Copyright 2014 Sidharth Iyer (246964@gmail.com)
%% Function signature
function range = attenuate(R, S, T)
%% Input
% _R_: Column vector of base node coverage radii
%%
% _S_: Vectorized array of source node coordinates such that
% _S_(_i_, :) = [ _Cx_ _Cy_ _Cz_ ]
%%
% _T_: Vectorized array of target node coordinates such that
% _T_(_i_, :) = [ _Cx_ _Cy_ _Cz_ ]
%% Output
% _range_: Column vector of attenuated ranges in the target directions
%% Pseudocode
% Iterate row-wise over input arrays
% Calculate unit vector UV(i) from S(i) to T(i)
% Use data sets to integrate attenuation factor along UV(i)
% Apply attenuation factor to R(i) and save as range(i)
% Return range(:)
% Dummy calculations for stub:
NUM = numel(R);
SV = zeros(NUM, 1);
TV = zeros(NUM, 1);
for i = 1 : NUM
SV(i) = sum(S(i,:)) * 0;
TV(i) = sum(T(i,:)) * 0;
end
%%
% Return the attenuated ranges for the given sources:
range = R + SV + TV; % Dummy return value for stub
end