From 7540e8290d4b770b23d94da734b6ddf9e208c287 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 10 Jun 2022 19:49:19 +0200 Subject: Switch to dictionary for the network matrices --- tests/mobility_wlan0_bandwidth_1s1r/simulator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/mobility_wlan0_bandwidth_1s1r/simulator.py') diff --git a/tests/mobility_wlan0_bandwidth_1s1r/simulator.py b/tests/mobility_wlan0_bandwidth_1s1r/simulator.py index 6d9d5fc..471f73b 100755 --- a/tests/mobility_wlan0_bandwidth_1s1r/simulator.py +++ b/tests/mobility_wlan0_bandwidth_1s1r/simulator.py @@ -26,13 +26,16 @@ import numpy as np B=np.full((2,2),8) L=np.full((2,2),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("receiver") def callback(simulator): simulator.log("Network update!") - simulator.update_network(simulator.B_wlan0*2,simulator.L_wlan0,simulator.B_eth0*2,simulator.L_eth0) + new_bw_wlan0=simulator.netmat["wlan0"]["bandwidth"]*2 + new_bw_eth0=simulator.netmat["eth0"]["bandwidth"]*2 + simulator.update_network({"wlan0":{"bandwidth":new_bw_wlan0, "latency":L},"eth0":{"bandwidth":new_bw_eth0, "latency":L}}) + s.run(breakpoints_every=1/2,breakpoint_callback=callback) -- cgit v1.2.3