minor edit to taxi_sim.py

This commit is contained in:
Luciano Ramalho 2015-02-11 01:16:32 -02:00
parent 88bc732264
commit 7d7a716f5d

View File

@ -32,7 +32,7 @@ class Simulator:
self.actors = list(actors) self.actors = list(actors)
self.time = 0 self.time = 0
def schedule_events(self, end_time): def schedule_events(self):
for actor in list(self.actors): for actor in list(self.actors):
try: try:
future_event = next(actor) future_event = next(actor)
@ -43,7 +43,7 @@ class Simulator:
def run(self, end_time): def run(self, end_time):
while self.time < end_time: while self.time < end_time:
self.schedule_events(end_time) self.schedule_events()
if self.events.empty(): if self.events.empty():
print('*** end of events ***') print('*** end of events ***')
break break