-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAMI.ned
50 lines (46 loc) · 1.11 KB
/
AMI.ned
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
package smart3p.simulations;
import smart3p.SmartMeter;
import smart3p.Collector;
import smart3p.UtilityCompany;
import smart3p.TrustedThirdParty;
import smart3p.DataGenerator;
//
// AMI network
//
network AMI
{
parameters:
int smNum = default(10);
int colNum = default(2);
volatile int smDelay @unit(ms) = default(exponential(100ms));
types:
// datarate is 250 kpbs max for ZigBee, average is ~163 kpsb on 70m distance
channel ZigBee extends ned.DatarateChannel
{
delay = smDelay;
datarate = 163kbps;
per = 0.1;
}
channel Wireless extends ned.DatarateChannel
{
delay = 1s;
datarate = 30Mbps;
}
submodules:
sms[smNum]: SmartMeter;
colls[colNum]: Collector;
uc: UtilityCompany;
ttp: TrustedThirdParty;
gen: DataGenerator;
connections:
for i=0..smNum-1
{
sms[i].generatorLine <--> gen.smLine++;
sms[i].radio <--> ZigBee <--> colls[floor(i/(smNum/colNum))].radio++;
}
for i=0..colNum-1
{
colls[i].ucLine <--> Wireless <--> uc.radio++;
}
uc.ttpLine <--> ttp.ucLine;
}