@@ -484,6 +484,7 @@ def simulate(self) -> None:
484
484
This loop requires the `Workload` to be populated with the `TaskGraph`s whose
485
485
execution is to be simulated using the Scheduler.
486
486
"""
487
+
487
488
def f ():
488
489
time_until_next_event = self .__time_until_next_event ()
489
490
running_tasks = self ._worker_pools .get_placed_tasks ()
@@ -511,10 +512,12 @@ def f():
511
512
else :
512
513
step_size = time_until_next_event
513
514
return step_size
515
+
514
516
self .__simulate_f (should_step = f )
515
517
516
518
def tick (self , until : EventTime ) -> None :
517
519
"""Tick the simulator until the specified time"""
520
+
518
521
def f ():
519
522
time_until_next_event = self .__time_until_next_event ()
520
523
if time_until_next_event .is_invalid ():
@@ -525,18 +528,20 @@ def f():
525
528
return time_until_next_event
526
529
else :
527
530
return None
531
+
528
532
self .__simulate_f (should_step = f )
529
533
530
534
def __simulate_f (self , should_step : Callable [[EventTime ], bool ]) -> None :
531
- """TODO doc
532
- """
535
+ """TODO doc"""
533
536
# Step the simulator loop.
534
537
while True :
535
538
step_size = should_step ()
536
539
if not step_size :
537
540
break
538
541
self .__step (step_size = step_size )
539
- if self ._event_queue .peek () and self .__handle_event (self ._event_queue .next ()):
542
+ if self ._event_queue .peek () and self .__handle_event (
543
+ self ._event_queue .next ()
544
+ ):
540
545
break
541
546
542
547
def get_current_placements_for_task_graph (
@@ -713,7 +718,7 @@ def __create_events_from_task_placement_skip(
713
718
)
714
719
self ._current_task_graph_placements [placement .task .task_graph ][
715
720
placement .task .id
716
- ] = placement
721
+ ] = placement
717
722
718
723
if task_graph .is_cancelled ():
719
724
released_tasks_from_new_task_graph = (
0 commit comments