-
Notifications
You must be signed in to change notification settings - Fork 1
/
simulate_fixed_network_hops.py
57 lines (47 loc) · 1.24 KB
/
simulate_fixed_network_hops.py
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
from multihop.Network import *
import matplotlib.pyplot as plt
from multihop.Network import *
import matplotlib.pyplot as plt
import random
import logging
from multihop.preambles import preambles
logging.getLogger().setLevel(logging.INFO)
random.seed(5555)
np.random.seed(19680801)
settings.PREAMBLE_DURATION_S = preambles[settings.LORA_SF][settings.MEASURE_INTERVAL_S]
network_route = {0: {
21: {},
20: {
4: {
7: {},
8: {},
9: {
18: {},
13: {
15: {},
26: {
27: {}
}
},
14: {}
},
10: {}
},
5: {},
6: {
11: {}
}
},
3: {}}}
print(flatten_node_tree(network_route))
network = Network(shape="random", size_x=30, size_y=30, fixed_route=network_route)
network.plot_network()
network.run()
network.plot_network()
network.plot_hops_statistic("pdr")
network.plot_hops_statistic("plr")
network.plot_hops_statistic("aggregation_efficiency")
network.plot_hops_statistic("energy", relative="min")
network.plot_hops_statistic("latency")
network.plot_hops_statistic_energy_per_state()
print("Test")