summaryrefslogtreecommitdiff
path: root/tests/mobility_eth0_latency_2s1r/simulator.py
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-06-10 19:49:19 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2022-06-10 19:49:19 +0200
commit7540e8290d4b770b23d94da734b6ddf9e208c287 (patch)
tree9d48046efac403cd5df78a5270a6ffdbfdc20235 /tests/mobility_eth0_latency_2s1r/simulator.py
parent94b47ceab5c910a6f17b5a4b69d2e14161be073e (diff)
Switch to dictionary for the network matrices
Diffstat (limited to 'tests/mobility_eth0_latency_2s1r/simulator.py')
-rwxr-xr-xtests/mobility_eth0_latency_2s1r/simulator.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/mobility_eth0_latency_2s1r/simulator.py b/tests/mobility_eth0_latency_2s1r/simulator.py
index ccc2a63..32ea84b 100755
--- a/tests/mobility_eth0_latency_2s1r/simulator.py
+++ b/tests/mobility_eth0_latency_2s1r/simulator.py
@@ -29,7 +29,7 @@ import numpy as np
B=np.full((3,3),8)
L=np.full((3,3),0)
-s=esds.Simulator(B,L,B,L)
+s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L},"eth0":{"bandwidth":B, "latency":L}})
s.create_node("sender")
s.create_node("sender")
@@ -37,6 +37,8 @@ s.create_node("receiver")
def callback(simulator):
simulator.log("Network update!")
- simulator.update_network(simulator.B_wlan0,simulator.L_wlan0+0.5,simulator.B_eth0,simulator.L_eth0+0.5)
+ new_lat_wlan0=simulator.netmat["wlan0"]["latency"]+1/2
+ new_lat_eth0=simulator.netmat["eth0"]["latency"]+1/2
+ simulator.update_network({"wlan0":{"bandwidth":B, "latency":new_lat_wlan0},"eth0":{"bandwidth":B, "latency":new_lat_eth0}})
s.run(breakpoints_every=1,breakpoint_callback=callback,debug=True)