sampo.scheduler.topological.base#

Overview#

Classes#

TopologicalScheduler

Scheduler, that represent ‘WorkGraph’ in topological order.

RandomizedTopologicalScheduler

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.GenericScheduler

Scheduler, 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: TopologicalScheduler

Scheduler, 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