summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--esds/debug.py11
-rw-r--r--example/platform.yaml10
2 files changed, 11 insertions, 10 deletions
diff --git a/esds/debug.py b/esds/debug.py
index 5423461..e376a77 100644
--- a/esds/debug.py
+++ b/esds/debug.py
@@ -37,7 +37,7 @@ class Debug:
def get_network_interfaces(self):
data=dict()
for interface in self.simulator.netmat:
- data[interface]={
+ data[interface]={
"is_wired":self.simulator.netmat[interface]["is_wired"],
"bandwidth": self.simulator.netmat[interface]["bandwidth"].tolist(),
"latency": self.simulator.netmat[interface]["latency"].tolist(),
@@ -46,7 +46,7 @@ class Debug:
data[interface]["sharing"]=self.simulator.sharing[interface].tolist()
return(data)
-
+
def get_events_list(self):
events=list()
for event_numpy in self.simulator.events:
@@ -72,7 +72,7 @@ class Debug:
elif event_id == 4:
final_content={
"node": content
- }
+ }
event={
"id": event_id,
"ts": event_numpy[1],
@@ -81,12 +81,13 @@ class Debug:
}
events.append(event)
return(events)
-
+
def get_nodes_infos(self):
nodes_infos=list()
for node in self.simulator.nodes:
node_info = {
- "turned_on": node["turned_on"]
+ "turned_on": node["turned_on"],
+ "interfaces": list(node["interfaces"].keys())
}
nodes_infos.append(node_info)
return(nodes_infos)
diff --git a/example/platform.yaml b/example/platform.yaml
index 7632e50..589ef62 100644
--- a/example/platform.yaml
+++ b/example/platform.yaml
@@ -3,14 +3,14 @@ general:
# List of timestamps at which the simulator should break
# and call the callback function (cf. the breakpoints_callback entry)
breakpoints: []
- # Same as breakpoints but simulator will break every x second(s)
+ # Same as breakpoints but simulator will break every x second(s)
breakpoints_every: 1000
# Define the callback to call when the simulator reach a breakpoint
breakpoints_callback:
file: "platform_callback.py"
callback: "callback"
# Turn on/off the debugging mode of esds
- debug: off
+ debug: on
# Debug output file (default is ./esds.debug)
debug_file: "./esds.debug"
# Should esds take into account interferences
@@ -21,7 +21,7 @@ nodes:
# Number of nodes to simulate
count: 5
# List of files used as implementation for each node
- # Example:
+ # Example:
# - 0,1,2 sender.py
# - 3-4 receiver.py
# Note that @ will be replaced by the last node id example for 5 nodes:
@@ -60,5 +60,5 @@ interfaces:
eth0:
type: "wired"
nodes: all
- links:
- - all 5Mbps 10s all \ No newline at end of file
+ links:
+ - all 5Mbps 10s all