-
Notifications
You must be signed in to change notification settings - Fork 14
/
FemtoStation_3S.m
63 lines (60 loc) · 1.6 KB
/
FemtoStation_3S.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
classdef FemtoStation_3S
properties
X
Y
P
dBS
dMUE
dFUE
FUEX
FUEY
M % distance with MUE
B % distance with BS
dM1 = 15; dM2 = 50; dM3 = 125;
dB1 = 50; dB2 = 150; dB3 = 400;
state = zeros(1,2)
powerProfile = []
C_FUE
C_profile = []
end
methods
function obj = FemtoStation_3S(xPos, yPos, BS, MUE, dFUE)
obj.X = xPos;
obj.Y = yPos;
obj.dBS = sqrt((xPos-BS.X)^2 + (yPos-BS.Y)^2);
obj.dMUE = nearest_MUE(xPos, yPos, MUE);% sqrt((xPos-MUE.X)^2 + (yPos-MUE.Y)^2); %distance to nearest MUE
obj.dFUE = dFUE;
obj.FUEX = xPos;
obj.FUEY = yPos+dFUE;
end
function obj = setPower(obj,power)
% obj.P = 10^((power-30)/10);
obj.P = power;
obj.powerProfile = [obj.powerProfile power];
end
function obj = setCapacity(obj,c)
obj.C_FUE = c;
obj.C_profile = [obj.C_profile c];
end
function obj = getDistanceStatus(obj)
if(obj.dMUE <= obj.dM1 )
obj.state(2) = 0;
elseif(obj.dMUE <= obj.dM2 )
obj.state(2) = 1;
elseif(obj.dMUE <= obj.dM3 )
obj.state(2) = 2;
else
obj.state(2) = 3;
end
if(obj.dBS <= obj.dB1 )
obj.state(3) = 0;
elseif(obj.dBS <= obj.dB2 )
obj.state(3) = 1;
elseif(obj.dBS <= obj.dB3 )
obj.state(3) = 2;
else
obj.state(3) = 3;
end
end
end
end