mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-06 01:56:27 +02:00
Update platform definition
This commit is contained in:
parent
d11a867b3c
commit
f4f1d97504
3 changed files with 34 additions and 3 deletions
|
@ -51,6 +51,7 @@ class YAMLPlatformFile:
|
|||
"breakpoints_file": None,
|
||||
"breakpoints_callback": None,
|
||||
"debug": False,
|
||||
"debug_file": "./esds.debug",
|
||||
"interferences": True,
|
||||
"node_count": 0,
|
||||
"implementations": [],
|
||||
|
@ -188,6 +189,8 @@ class YAMLPlatformFile:
|
|||
if type(general["debug"]) != bool:
|
||||
self.parsing_error("debug should be on or off")
|
||||
self.default["debug"]=general["debug"]
|
||||
if "debug_file" in general:
|
||||
self.default["debug_file"]=general["debug"]
|
||||
if "interferences" in general:
|
||||
if type(general["interferences"]) != bool:
|
||||
self.parsing_error("interferences should be on or off")
|
||||
|
|
|
@ -26,7 +26,7 @@ class Simulator:
|
|||
be handle before any other one. That way after a wait, nodes a ready perform receivet() with timeout=0.
|
||||
"""
|
||||
|
||||
def __init__(self,netmat):
|
||||
def __init__(self,netmat,debug_file_path="./esds.debug"):
|
||||
"""
|
||||
Format of netmat: { "interface": {"bandwidth": numpy_matrix_2D, "latency": numpy_matrix_2D, "is_wired":bool}}
|
||||
For wireless interfaces the diagonals of the bandwidth and latency matrices are very important.
|
||||
|
@ -45,7 +45,7 @@ class Simulator:
|
|||
self.events_dirty=True # For optimization reasons
|
||||
self.startat=-1
|
||||
self.time=0
|
||||
self.debug_file_path="./esds.debug"
|
||||
self.debug_file_path=debug_file_path
|
||||
self.precision=".3f"
|
||||
self.interferences=True
|
||||
self.wait_end_nodes=list() # Keep track of nodes that wait for the end of the simulation
|
||||
|
|
|
@ -1,24 +1,52 @@
|
|||
##### General Section #####
|
||||
general:
|
||||
# List of timestamps where the simulator will break
|
||||
# and call the callback function (cf breakpoints_callback entry)
|
||||
breakpoints: []
|
||||
# Same as breakpoints but simulator will break every x second(s)
|
||||
breakpoints_every: 0
|
||||
# Define the callback to call when the simulator reach a breakpoint
|
||||
breakpoints_callback:
|
||||
file: "platform_test.py"
|
||||
callback: "callback"
|
||||
# Turn on/off the debugging of esds
|
||||
debug: off
|
||||
# Debug output file (default is ./esds.debug)
|
||||
debug_file: "./esds.debug"
|
||||
# Should esds take into account interferences
|
||||
interferences: on
|
||||
|
||||
##### Nodes Section #####
|
||||
nodes:
|
||||
# Number of nodes to simulate
|
||||
count: 5
|
||||
# List of files used has implementation for each node
|
||||
# Example:
|
||||
# - 0,1,2 sender.py
|
||||
# - 3-4 receiver.py
|
||||
# Note that @ will be replaced by the last node id ex:
|
||||
# 0-@ receiver.py is equivalent to 0-4 receiver.py
|
||||
implementations:
|
||||
- all sender.py
|
||||
|
||||
##### Interfaces Section #####
|
||||
interfaces:
|
||||
# Each entry for each node interfaces
|
||||
wlan0:
|
||||
# Interface type (wired/wireless)
|
||||
type: "wireless"
|
||||
# List of links between nodes in this interface
|
||||
# Syntax infos:
|
||||
# 1MBps = 1 megaBYTE per seconds
|
||||
# 1Mbps = 1 megabit per seconds
|
||||
# Each entry has the following format: <ListOfNodes> <Bandwidth> <Latency> <ListOfNodes>
|
||||
links:
|
||||
- 0 1Bps 10s 0
|
||||
- 0 1Bps 10s 0
|
||||
# List of transmission performance for each nodes (only for wireless interfaces)
|
||||
# Each entry has the following format: <ListOfNodes> <Bandwidth> <Latency>
|
||||
txperfs:
|
||||
- 0-4 1Bps 10s
|
||||
# Example of a wired interface
|
||||
eth0:
|
||||
type: "wired"
|
||||
links:
|
||||
|
|
Loading…
Add table
Reference in a new issue