-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetParameters.m
86 lines (66 loc) · 2.06 KB
/
setParameters.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
function [Area,Model]=setParameters(n)
%%%%%%%%%%%%%%%%%%%%%%%%% Set Inital PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
%Field Dimensions - x and y maximum (in meters)
Area.x=n;
Area.y=n;
Area.z=n;
%Sink Motion pattern
Sinkx=[15 50 110 175 33 130 100 ];
Sinky=[rand()*100 rand()*100 rand()*100 rand()*100 rand()*100 rand()*100 rand()*100];
Sinkz=[(20)*rand()+100 (20)*rand()+100 (20)*rand()+100 (20)*rand()+100 (20)*rand()+200 (20)*rand()+200 300];
%Query flag
queryStarted = false;
%Optimal Election Probability of a node to become cluster head
p=0.1;
%%%%%%%%%%%%%%%%%%%%%%%%% Energy Model (all values in Joules)%%%%%%%%%%%
%Initial Energy
Eo=0.5;
%Eelec=Etx -> transmission energy
%Erx -> receiving energy
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy for cluster head
EDA=5*0.000000001;
%Computation of do
do=sqrt(Efs/Emp);
%%%%%%%%%%%%%%%%%%%%%%%%% Run Time Parameters %%%%%%%%%%%%%%%%%%%%%%%%%
%maximum number of rounds
rmax=2;
%Data packet size in bits
DpacketLen=480;
%Hello packet size in bits
HpacketLen=100;
%Number of Packets sended in steady-state phase
NumPacket=10;
%Redio Range
RR=sqrt((80*80)+(100*100)+(40*40));
%fields in dataset
Vars = ["CO", "TinOxide", "NonMetanicHydroCarbons", "Benzene", "Titania", "NOx", "TungstenOxide_3", "NO2", "TungstenOxide_4", "IndiumOxide", "Temperature", "RelativeHumidity", "AbsoluteHumidity"];
%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% Save in Model %%%%%%%%%%%%%%%%%%%%%%%%%%%%
Model.n=n;
Model.Sinkx=Sinkx;
Model.Sinky=Sinky;
Model.Sinkz=Sinkz;
Model.p=p;
Model.Eo=Eo;
Model.ETX=ETX;
Model.ERX=ERX;
Model.Efs=Efs;
Model.Emp=Emp;
Model.EDA=EDA;
Model.do=do;
Model.rmax=rmax;
Model.DpacketLen=DpacketLen;
Model.HpacketLen=HpacketLen;
Model.NumPacket=NumPacket;
Model.RR=RR;
Model.QueryStarted = queryStarted;
Model.QueryStartTime = "0";
Model.QueryEndTime = "0";
Model.QueryDelta = "0";
Model.Vars = Vars;
end