@startuml legend right Short legend endlegend title **Scheduler.compute_schedule()** skinparam activity { 'StartColor red 'BarColor SaddleBrown 'EndColor Silver 'BackgroundColor Peru BackgroundColor<> Orange 'BorderColor Peru 'FontName Impact } (*) --> "//# Order schedule sequences according to efficiency criteria (priority, set time, ...)//" <> --> "//# Create a unique big empty available interval that takes all the night duration [plan_start,plan_end]// \n intervals = Interval(schedule.plan_start, schedule.plan_end)" --> "//# Remove invalid sequences from schedule, and mark them INVALID// \n A sequence is invalid if: - sequence.jd1 < 0 - OR sequence.jd2 < 0 - OR sequence.duration <= 0 - OR sequence.jd2 - sequence.jd1 < sequence.duration \n\n **remove_invalid_sequences()**\l" <> --> "//# **TODO:** Determine priorities according to SP, user, ...// **determine_priorities()**\l" as B1 <> --> "//# Remove non eligible sequences from schedule// **remove_non_eligible_sequences()**\l" <> --> "//# Sort sequences according to highest priority and soonest JD2// **sort_by_jd2_and_priorities()**\l" <> --> "//# Try to place sorted sequences in schedule one by one in available intervals (shift placed sequences if necessary)// **place_sequences()**\l" <> --> (*) @enduml