diff --git a/SAS/TMSS/backend/services/scheduling/lib/dynamic_scheduling.py b/SAS/TMSS/backend/services/scheduling/lib/dynamic_scheduling.py index c726812b0e05525a97618b1686d62f33c53ef0c8..bcd4255c380b871975b3d991d2d1cd008da3c6fc 100644 --- a/SAS/TMSS/backend/services/scheduling/lib/dynamic_scheduling.py +++ b/SAS/TMSS/backend/services/scheduling/lib/dynamic_scheduling.py @@ -161,7 +161,7 @@ def assign_start_stop_times_to_schedulable_scheduling_units(lower_bound_start_ti # scheduling_unit also be updated? Currently its a cached property # keep track of the lower_bound_start_time based on last sub.stoptime and gap - lower_bound_start_time = scheduling_unit.stop_time + DEFAULT_INTER_OBSERVATION_GAP + lower_bound_start_time = scheduling_unit.scheduled_stop_time + DEFAULT_INTER_OBSERVATION_GAP scheduling_units.remove(scheduling_unit) else: @@ -334,14 +334,14 @@ def unschededule_blocking_scheduled_units_if_needed_and_possible(candidate: Scor if (not scheduled_scheduling_unit.interrupts_telescope) or candidate.scheduling_unit.project.trigger_priority > scheduled_scheduling_unit.project.trigger_priority: logger.info("unscheduling id=%s '%s' because it is in the way and has a lower trigger_priority=%s than the best candidate id=%s '%s' trigger_priority=%s start_time=%s", scheduled_scheduling_unit.id, scheduled_scheduling_unit.name, scheduled_scheduling_unit.project.trigger_priority, - candidate.scheduling_unit.id, candidate.scheduling_unit.name, candidate.scheduling_unit.project.trigger_priority, candidate.scheduling_unit.start_time) + candidate.scheduling_unit.id, candidate.scheduling_unit.name, candidate.scheduling_unit.project.trigger_priority, candidate.scheduling_unit.scheduled_start_time) unschedule_subtasks_in_scheduling_unit_blueprint(scheduled_scheduling_unit) elif candidate.weighted_score > scheduled_score.weighted_score: # ToDo: also check if the scheduled_scheduling_unit is manually/dynamically scheduled logger.info("unscheduling id=%s '%s' because it is in the way and has a lower score than the best candidate id=%s '%s' score=%s start_time=%s", scheduled_scheduling_unit.id, scheduled_scheduling_unit.name, - candidate.scheduling_unit.id, candidate.scheduling_unit.name, candidate.weighted_score, candidate.scheduling_unit.start_time) + candidate.scheduling_unit.id, candidate.scheduling_unit.name, candidate.weighted_score, candidate.scheduling_unit.scheduled_start_time) unschedule_subtasks_in_scheduling_unit_blueprint(scheduled_scheduling_unit) @@ -351,7 +351,7 @@ def unschededule_blocking_scheduled_units_if_needed_and_possible(candidate: Scor if scheduled_scheduling_units: # accept current solution with current scheduled_scheduling_units logger.info("keeping current scheduled unit(s) which have a better (or equal) score: %s", "; ".join( - "id=%s '%s' start_time='%s'" % (su.id, su.name, su.start_time) for su in scheduled_scheduling_units)) + "id=%s '%s' start_time='%s'" % (su.id, su.name, su.scheduled_start_time) for su in scheduled_scheduling_units)) # indicate there are still blocking units return False @@ -377,7 +377,7 @@ def cancel_running_observation_if_needed_and_possible(candidate: ScoredSchedulin logger.info('cancelling observation subtask pk=%s trigger_priority=%s because it blocks the triggered scheduling_unit pk=%s trigger_priority=%s' % (obs.pk, obs.project.trigger_priority, candidate.scheduling_unit.pk, candidate.scheduling_unit.project.trigger_priority)) # todo: check if cancellation is really necessary or the trigger can be scheduled afterwards - # I guess we could just do can_run_after(candidate, obs.stop_time) here for that? + # I guess we could just do can_run_after(candidate, obs.scheduled_stop_time) here for that? # We could also only do this, of there is a 'before' constraint on each trigger. # -> Clarify and implemented with TMSS-704. cancel_subtask(obs)