mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-19 03:59:45 +00:00
Switch to dictionary for the network matrices
This commit is contained in:
parent
94b47ceab5
commit
7540e8290d
26 changed files with 72 additions and 72 deletions
|
@ -27,13 +27,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,simulator.L_wlan0+1/2,simulator.B_eth0,simulator.L_eth0+1/2)
|
||||
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/2,breakpoint_callback=callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue