Cleaning event loop

This commit is contained in:
Loic Guegan 2022-09-13 10:20:37 +02:00
parent 14feec9657
commit 3ae36dadc1

View file

@ -397,10 +397,10 @@ class Simulator:
# Process events
while len(self.events) > 0 and self.events[0,1] == self.time:
event=self.events[0]
event_type=int(event[0])
ts=self.events[0,1]
content=self.events[0,2]
event=self.events[0] # Next event (self.events is sorted by timestamp and priorities)
event_type=int(event[0]) # Event type
ts=event[1] # Timestamp
content=event[2] # Event content
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=content