summaryrefslogtreecommitdiff
path: root/esds
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-09-11 13:45:06 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2022-09-11 13:45:06 +0200
commitf4f1d975043223b6a5fb512946f6d7c0e3ee791f (patch)
tree27bdc9fb591f1ae03cb44c9d2c43885d391518ab /esds
parentd11a867b3ca46287b9b62356fc25836b7f19b757 (diff)
Update platform definition
Diffstat (limited to 'esds')
-rw-r--r--esds/helpers/platform.py3
-rw-r--r--esds/simulator.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/esds/helpers/platform.py b/esds/helpers/platform.py
index e2f780d..341baed 100644
--- a/esds/helpers/platform.py
+++ b/esds/helpers/platform.py
@@ -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")
diff --git a/esds/simulator.py b/esds/simulator.py
index adb2011..2e69884 100644
--- a/esds/simulator.py
+++ b/esds/simulator.py
@@ -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