Update all integration tests and debug platform parsing

This commit is contained in:
Loic Guegan 2022-09-13 15:49:38 +02:00
parent 17bfda379b
commit be6dafcd10
61 changed files with 167 additions and 753 deletions

View file

@ -0,0 +1,7 @@
#!/usr/bin/env python
def callback(simulator):
simulator.log("Network update!")
L=simulator.netmat["wlan0"]["latency"]
new_bw_wlan0=simulator.netmat["wlan0"]["bandwidth"]*2
simulator.update_network({"wlan0":{"bandwidth":new_bw_wlan0, "latency":L, "is_wired":False}})

View file

@ -1,9 +1,3 @@
#!/usr/bin/env python
# Load ESDS
import esds
import numpy as np
########## Scenario ##########
# Notations:
# - Remaining communication duration (last communication ends minus current simulated time) = C
@ -22,18 +16,22 @@ import numpy as np
# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
##############################
B=np.full((2,2),8)
L=np.full((2,2),0)
s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L, "is_wired":False}, "eth0":{"bandwidth":B, "latency":L, "is_wired":True}})
general:
breakpoints_every: 0.5
breakpoints_callback:
file: "mobility.py"
callback: "callback"
s.create_node("sender")
s.create_node("receiver")
nodes:
count: 2
implementations:
- 0 sender.py
- 1 receiver.py
def callback(simulator):
simulator.log("Network update!")
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, "is_wired":False}, "eth0":{"bandwidth":new_bw_eth0, "latency":L, "is_wired":True}})
s.run(breakpoints_every=1/2,breakpoint_callback=callback)
interfaces:
wlan0:
type: "wireless"
links:
- all 1Bps 0s all
txperfs:
- all 1Bps 0s