-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtestB.py
More file actions
37 lines (25 loc) · 808 Bytes
/
testB.py
File metadata and controls
37 lines (25 loc) · 808 Bytes
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
from TestSim import TestSim
def main():
# Get simulation ready to run.
s = TestSim();
# Before we do anything, lets simulate the network off.
s.runTime(1);
# Load the the layout of the network.
s.loadTopo("pizza.topo");
# Add a noise model to all of the motes.
s.loadNoise("meyer-heavy.txt");
# Turn on all of the sensors.
s.bootAll();
# Add the main channels. These channels are declared in includes/channels.h
s.addChannel(s.COMMAND_CHANNEL);
s.addChannel(s.GENERAL_CHANNEL);
s.addChannel(s.TRANSPORT_CHANNEL);
# After sending a ping, simulate a little to prevent collision.
s.runTime(300);
s.testServer(1);
s.runTime(60);
s.testClient(13);
s.runTime(1);
s.runTime(1000);
if __name__ == '__main__':
main()