Skip to content
Snippets Groups Projects
Commit df03f390 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

quick fix for demo: start/stop time renamings

parent 76560efc
No related branches found
No related tags found
No related merge requests found
...@@ -161,7 +161,7 @@ def assign_start_stop_times_to_schedulable_scheduling_units(lower_bound_start_ti ...@@ -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 # 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 # 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) scheduling_units.remove(scheduling_unit)
else: else:
...@@ -334,14 +334,14 @@ def unschededule_blocking_scheduled_units_if_needed_and_possible(candidate: Scor ...@@ -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: 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", 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, 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) unschedule_subtasks_in_scheduling_unit_blueprint(scheduled_scheduling_unit)
elif candidate.weighted_score > scheduled_score.weighted_score: elif candidate.weighted_score > scheduled_score.weighted_score:
# ToDo: also check if the scheduled_scheduling_unit is manually/dynamically scheduled # 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", 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, 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) unschedule_subtasks_in_scheduling_unit_blueprint(scheduled_scheduling_unit)
...@@ -351,7 +351,7 @@ def unschededule_blocking_scheduled_units_if_needed_and_possible(candidate: Scor ...@@ -351,7 +351,7 @@ def unschededule_blocking_scheduled_units_if_needed_and_possible(candidate: Scor
if scheduled_scheduling_units: if scheduled_scheduling_units:
# accept current solution with current 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( 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 # indicate there are still blocking units
return False return False
...@@ -377,7 +377,7 @@ def cancel_running_observation_if_needed_and_possible(candidate: ScoredSchedulin ...@@ -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' % 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)) (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 # 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. # We could also only do this, of there is a 'before' constraint on each trigger.
# -> Clarify and implemented with TMSS-704. # -> Clarify and implemented with TMSS-704.
cancel_subtask(obs) cancel_subtask(obs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment