diff --git a/esds/simulator.py b/esds/simulator.py index 74dcf3b..6048cdc 100644 --- a/esds/simulator.py +++ b/esds/simulator.py @@ -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