Make one sharing matrix per wired interface

This commit is contained in:
Loic Guegan 2022-06-10 21:58:15 +02:00
parent 3fef2bbf4b
commit d2a5ea6f53
26 changed files with 50 additions and 45 deletions

View file

@ -29,7 +29,7 @@ import numpy as np
B=np.full((3,3),8)
L=np.full((3,3),0)
s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L},"eth0":{"bandwidth":B, "latency":L}})
s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L, "is_wired":False}, "eth0":{"bandwidth":B, "latency":L, "is_wired":True}})
s.create_node("sender")
s.create_node("sender")
@ -39,6 +39,6 @@ def callback(simulator):
simulator.log("Network update!")
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}})
simulator.update_network({"wlan0":{"bandwidth":B, "latency":new_lat_wlan0, "is_wired":False},"eth0":{"bandwidth":B, "latency":new_lat_eth0, "is_wired":True}})
s.run(breakpoints_every=1,breakpoint_callback=callback,debug=True)