diff --git a/doc/uml/activities/scheduler/Scheduling.txt b/doc/uml/activities/scheduler/Scheduling.txt new file mode 100644 index 0000000..a82cc46 --- /dev/null +++ b/doc/uml/activities/scheduler/Scheduling.txt @@ -0,0 +1,78 @@ +@startuml + +'skinparam backgroundColor #AAFFFF + +skinparam activity { + 'StartColor red + 'BarColor SaddleBrown + 'EndColor Silver + 'BackgroundColor Peru + BackgroundColor<> Orange + 'BorderColor Peru + 'FontName Impact +} + +title **Actual scheduling algorithm (general overview)** + +(*) --> "Schedule Creation" + --> if "First Schedule ?" then + -->[yes] "schedule.plan_night_start = schedule.plan_start" + --> "Setting of sequences : a list of all the observable sequences" as A2 + else + -->[no] "Recovery of previous schedule's data: + EXECUTED sequences, plan_night_start, plan_end + copy_from_previous_schedule()\l" <> + endif + --> A2 + --> "//Add to each sequence its schedule id:// + sequences = [(sequence, shs) for sequence in sequences]" + + --> "Creation of the interval [plan_start ; plan_end] \land insertion in the intervals list" + + --> "Remove invalid sequences + bad parameters : jd1 < 0 for example + removeInvalidSequences()"<> + + --> "#TODO Determine priorities according to user and SP"<> + + -->"Remove non eligible sequences + //remove UNPLANNABLE sequences : overlap [jd1; jd2], [plan_start; plan_end] < duration for example// + removeNonEligibleSequences()" <> + + --> "Sort Sequences + //Sort sequences by priority and soonest jd2// + sortSequences()"<> + + --> "Check Quota + //Check if the user's quota is sufficient//" + -->if "Is Quota Sufficient ?" then + -->[no] "Reject Sequence" + + else + -->[yes]"Get matching intervals + //Get the matching intervals for the sequence//" + endif + -->if "Intervals Found ?" then + -->[yes] "Place sequence + placeSequence(sequence, shs, matching)" <> + --> ==P== + else + -->[no] "Try Shifting Sequences + //Trying to shift the left or/and right sequences// + //in order to fit the current sequence//" <> + + endif + --> ==P== + + --> if "Sequence PLACED ?" then + -->[yes] "Decrease quota()" <> + -->"Save Schedule + //set the sequence's status at PLANNED// + //and save the new schedule// + saveSchedule()"<> + else + -->[no] "Reject Sequence" + endif + + +@enduml \ No newline at end of file -- libgit2 0.21.2