sampo.scheduler.timeline.base#

Overview#

Classes#

Timeline

Entity that saves info on the use of resources over time.

Classes#

class sampo.scheduler.timeline.base.Timeline#

Bases: abc.ABC

Entity that saves info on the use of resources over time. Timeline provides opportunities to work with GraphNodes and resources over time.

abstract schedule(node: sampo.schemas.graph.GraphNode, node2swork: dict[sampo.schemas.graph.GraphNode, sampo.schemas.scheduled_work.ScheduledWork], passed_agents: list[sampo.schemas.resources.Worker], contractor: sampo.schemas.contractor.Contractor, spec: sampo.schemas.schedule_spec.WorkSpec, assigned_start_time: sampo.schemas.time.Time | None = None, assigned_time: sampo.schemas.time.Time | None = None, assigned_parent_time: sampo.schemas.time.Time = Time(0), work_estimator: sampo.schemas.time_estimator.WorkTimeEstimator = DefaultWorkEstimator()) sampo.schemas.time.Time#

Schedules the given GraphNode using passed agents, spec and times. If start time not passed, it should be computed as minimum work start time. :return: scheduled finish time of given work

find_min_start_time(node: sampo.schemas.graph.GraphNode, worker_team: list[sampo.schemas.resources.Worker], node2swork: dict[sampo.schemas.graph.GraphNode, sampo.schemas.scheduled_work.ScheduledWork], spec: sampo.schemas.schedule_spec.WorkSpec, parent_time: sampo.schemas.time.Time = Time(0), work_estimator: sampo.schemas.time_estimator.WorkTimeEstimator = DefaultWorkEstimator()) sampo.schemas.time.Time#

Computes start time, max parent time, contractor and exec times for given node.

Parameters:
  • worker_team – list of passed workers. It Should be IN THE SAME ORDER AS THE CORRESPONDING WREQS

  • node – the GraphNode whose minimum time we are trying to find

  • node2swork – dictionary, that match GraphNode to ScheduleWork respectively

  • spec – specification for given GraphNode

  • parent_time – the minimum start time

  • work_estimator – function that calculates execution time of the GraphNode

Returns:

minimum time

abstract find_min_start_time_with_additional(node: sampo.schemas.graph.GraphNode, worker_team: list[sampo.schemas.resources.Worker], node2swork: dict[sampo.schemas.graph.GraphNode, sampo.schemas.scheduled_work.ScheduledWork], spec: sampo.schemas.schedule_spec.WorkSpec, assigned_start_time: sampo.schemas.time.Time | None = None, assigned_parent_time: sampo.schemas.time.Time = Time(0), work_estimator: sampo.schemas.time_estimator.WorkTimeEstimator = DefaultWorkEstimator()) tuple[sampo.schemas.time.Time, sampo.schemas.time.Time, dict[sampo.schemas.graph.GraphNode, tuple[sampo.schemas.time.Time, sampo.schemas.time.Time]]]#
abstract update_timeline(finish_time: sampo.schemas.time.Time, node: sampo.schemas.graph.GraphNode, node2swork: dict[sampo.schemas.graph.GraphNode, sampo.schemas.scheduled_work.ScheduledWork], worker_team: list[sampo.schemas.resources.Worker], spec: sampo.schemas.schedule_spec.WorkSpec)#
abstract __getitem__(item)#