mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-10 09:03:12 +00:00
sim: do not exit on empty event loop
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
5c896dfd3d
commit
83209c0c33
@ -119,7 +119,7 @@ class Sim:
|
||||
return event
|
||||
except IndexError:
|
||||
print("No more events in the simulation queue. Terminating.")
|
||||
sys.exit(0)
|
||||
return None
|
||||
|
||||
def cancel_event(self, event):
|
||||
"""
|
||||
@ -151,6 +151,8 @@ class Sim:
|
||||
while self.time <= self.duration:
|
||||
# get next event and call the handle method of the destination
|
||||
event = self.next_event()
|
||||
if not event:
|
||||
return
|
||||
dst = event.get_destination()
|
||||
dst.handle_event(event)
|
||||
# get current real time
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user