mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-19 03:59:45 +00:00
Refactoring
This commit is contained in:
parent
6b697fa14f
commit
be6d819080
1 changed files with 3 additions and 3 deletions
|
@ -353,10 +353,10 @@ class Simulator:
|
||||||
f.write("Breakpoints every "+str(breakpoints_every)+"s\n")
|
f.write("Breakpoints every "+str(breakpoints_every)+"s\n")
|
||||||
##### Simulation loop
|
##### Simulation loop
|
||||||
while True:
|
while True:
|
||||||
# Synchronize every nodes
|
# Synchronize non-blocking api calls
|
||||||
for node in self.nodes:
|
for node in self.nodes:
|
||||||
self.sync_node_non_blocking(node)
|
self.sync_node_non_blocking(node)
|
||||||
# Manage events
|
# Synchronize blocking api calls
|
||||||
for node in self.nodes:
|
for node in self.nodes:
|
||||||
self.sync_node_blocking(node)
|
self.sync_node_blocking(node)
|
||||||
# Generate debug logs
|
# Generate debug logs
|
||||||
|
@ -369,7 +369,7 @@ class Simulator:
|
||||||
for node_id in self.wait_end_nodes:
|
for node_id in self.wait_end_nodes:
|
||||||
self.nodes[node_id]["state"]="running"
|
self.nodes[node_id]["state"]="running"
|
||||||
self.nodes[node_id].rqueue.put(("sim_end",0))
|
self.nodes[node_id].rqueue.put(("sim_end",0))
|
||||||
self.sync_node_non_blocking(self.nodes[node_id]) # Allow them for make call requests (printing logs for example)
|
self.sync_node_non_blocking(self.nodes[node_id]) # Allow them for make non-blocking call requests (printing logs for example)
|
||||||
break # End the event processing loop
|
break # End the event processing loop
|
||||||
|
|
||||||
# Update simulation time
|
# Update simulation time
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue