sampo.scheduler.topological.base#
Overview#
Scheduler, that represent ‘WorkGraph’ in topological order. |
|
Scheduler, that represent ‘WorkGraph’ in topological order with random. |
Classes#
- class sampo.scheduler.topological.base.TopologicalScheduler(scheduler_type: sampo.scheduler.base.SchedulerType = SchedulerType.Topological, work_estimator: sampo.schemas.time_estimator.WorkTimeEstimator = DefaultWorkEstimator())#
Bases:
sampo.scheduler.generic.GenericSchedulerScheduler, that represent ‘WorkGraph’ in topological order.
- _topological_sort(wg: sampo.schemas.graph.WorkGraph, work_estimator: sampo.schemas.time_estimator.WorkTimeEstimator) list[sampo.schemas.graph.GraphNode]#
Sort ‘WorkGraph’ in topological order.
- Parameters:
wg – WorkGraph
work_estimator – function that calculates execution time of the work
- Returns:
list of sorted nodes in graph
- class sampo.scheduler.topological.base.RandomizedTopologicalScheduler(work_estimator: sampo.schemas.time_estimator.WorkTimeEstimator = DefaultWorkEstimator(), random_seed: int | None = None)#
Bases:
TopologicalSchedulerScheduler, that represent ‘WorkGraph’ in topological order with random.
- _topological_sort(wg: sampo.schemas.graph.WorkGraph, work_estimator: sampo.schemas.time_estimator.WorkTimeEstimator) list[sampo.schemas.graph.GraphNode]#
Sort ‘WorkGraph’ in topological order.
- Parameters:
wg – WorkGraph
work_estimator – function that calculates execution time of the work
- Returns:
list of sorted nodes in graph