sampo.scheduler.base#
Overview#
Generic enumeration. |
|
Base class that implements the logic of the planning process. |
Classes#
- class sampo.scheduler.base.SchedulerType#
Bases:
enum.EnumGeneric enumeration.
Derive from this class to define new enumerations.
- Genetic = 'genetic'#
- Topological = 'topological'#
- HEFTAddEnd = 'heft_add_end'#
- HEFTAddBetween = 'heft_add_between'#
- class sampo.scheduler.base.Scheduler(scheduler_type: SchedulerType, resource_optimizer: sampo.scheduler.resource.base.ResourceOptimizer = CoordinateDescentResourceOptimizer(dichotomy_int), work_estimator: sampo.schemas.time_estimator.WorkTimeEstimator = DefaultWorkEstimator())#
Bases:
abc.ABCBase class that implements the logic of the planning process.
- scheduler_type: SchedulerType#
- resource_optimizer: sampo.scheduler.resource.base.ResourceOptimizer#
- __str__()#
Return str(self).
- schedule(wg: sampo.schemas.graph.WorkGraph, contractors: list[sampo.schemas.contractor.Contractor], spec: sampo.schemas.schedule_spec.ScheduleSpec = ScheduleSpec(), validate: bool = False, start_time: sampo.schemas.time.Time = Time(0), timeline: sampo.scheduler.timeline.base.Timeline | None = None, landscape: sampo.schemas.landscape.LandscapeConfiguration = LandscapeConfiguration()) sampo.schemas.schedule.Schedule#
Implementation of a scheduling process. ‘schedule’ version returns only Schedule.
- Returns:
Schedule
- abstract schedule_with_cache(wg: sampo.schemas.graph.WorkGraph, contractors: list[sampo.schemas.contractor.Contractor], landscape: sampo.schemas.landscape.LandscapeConfiguration = LandscapeConfiguration(), spec: sampo.schemas.schedule_spec.ScheduleSpec = ScheduleSpec(), validate: bool = False, assigned_parent_time: sampo.schemas.time.Time = Time(0), timeline: sampo.scheduler.timeline.base.Timeline | None = None) tuple[sampo.schemas.schedule.Schedule, sampo.schemas.time.Time, sampo.scheduler.timeline.base.Timeline, list[sampo.schemas.graph.GraphNode]]#
Extended version of ‘schedule’ method. Returns much inner info about a scheduling process, not only Schedule.
- Returns:
resulting schedule, finish time, resulting timeline used for scheduling and node_order used for scheduling
- static optimize_resources_using_spec(work_unit: sampo.schemas.works.WorkUnit, worker_team: list[sampo.schemas.resources.Worker], work_spec: sampo.schemas.schedule_spec.WorkSpec, optimize_lambda: Callable[[numpy.ndarray], None] = lambda _: ...)#
Applies worker team spec to an optimization process. Can use arbitrary heuristics to increase spec handling efficiency.
- Parameters:
work_unit – current work unit
worker_team – current worker team from chosen contractor
work_spec – spec for given work unit
optimize_lambda – optimization func that should hold optimization data in its closure and run optimization process when receives optimize_array. Passing None or default value means this function should only apply spec.