diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-09-13 10:04:27 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-09-13 10:04:27 +0200 |
| commit | 14feec9657b8e25163290f798f76edbc02e7ea90 (patch) | |
| tree | c1e3994d342e4e3d78d188e8e65f5b145a6b5274 | |
| parent | a2c5db3882a53b897ef8ff3c0186739f2851f28a (diff) | |
Debug callbacks
| -rw-r--r-- | esds/simulator.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/esds/simulator.py b/esds/simulator.py index 4713fa5..74dcf3b 100644 --- a/esds/simulator.py +++ b/esds/simulator.py @@ -397,12 +397,13 @@ class Simulator: # Process events while len(self.events) > 0 and self.events[0,1] == self.time: - event_type=int(self.events[0,0]) + event=self.events[0] + event_type=int(event[0]) ts=self.events[0,1] - event=self.events[0,2] + content=self.events[0,2] self.events=np.delete(self.events,0,0) # Consume events NOW! not at the end of the loop (event list may change in between) if event_type == 0: - src_id,dst_id,interface, data, datasize,duration,datasize_remaining,start_at,perform_delivery,receiver_required=event + src_id,dst_id,interface, data, datasize,duration,datasize_remaining,start_at,perform_delivery,receiver_required=content src=self.nodes[int(src_id)] dst=self.nodes[int(dst_id)] if self.netmat[interface]["is_wired"]: @@ -442,12 +443,12 @@ class Simulator: self.sync_node_non_blocking(src,timeout_remove_only=True) self.notify_node_plugins(src, "on_communication_end", event) elif event_type == 1: # Timeout - node=self.nodes[int(event)] + node=self.nodes[int(content)] node["state"]="running" node.rqueue.put(("timeout",RCode.SUCCESS)) self.sync_node_non_blocking(node,timeout_remove_only=True) elif event_type == 4: - node=self.nodes[int(event)] + node=self.nodes[int(content)] node["state"]="running" node.rqueue.put(("notify",RCode.SUCCESS)) self.sync_node_non_blocking(node,timeout_remove_only=True) |
