mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-06-07 22:07:40 +00:00
Update all integration tests and debug platform parsing
This commit is contained in:
parent
17bfda379b
commit
be6dafcd10
61 changed files with 167 additions and 753 deletions
8
tests/mobility_eth0_bandwidth_1s1r/mobility.py
Executable file
8
tests/mobility_eth0_bandwidth_1s1r/mobility.py
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
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":simulator.netmat["wlan0"]["latency"], "is_wired":False}, "eth0":{"bandwidth":new_bw_eth0, "latency":simulator.netmat["eth0"]["latency"], "is_wired":True}})
|
||||
|
39
tests/mobility_eth0_bandwidth_1s1r/simulator.py → tests/mobility_eth0_bandwidth_1s1r/platform.yaml
Executable file → Normal file
39
tests/mobility_eth0_bandwidth_1s1r/simulator.py → tests/mobility_eth0_bandwidth_1s1r/platform.yaml
Executable file → Normal 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,17 +16,26 @@ 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
|
||||
eth0:
|
||||
type: "wired"
|
||||
links:
|
||||
- all 1Bps 0s all
|
Loading…
Add table
Add a link
Reference in a new issue