Commit 2a8d74fa485195e30daceee702249c84dde58b02

Authored by Quentin Durand
1 parent ebdda77e
Exists in dev

A general oveview of the Scheduler algorithm

Showing 1 changed file with 78 additions and 0 deletions   Show diff stats
doc/uml/activities/scheduler/Scheduling.txt 0 → 100644
... ... @@ -0,0 +1,78 @@
  1 +@startuml
  2 +
  3 +'skinparam backgroundColor #AAFFFF
  4 +
  5 +skinparam activity {
  6 + 'StartColor red
  7 + 'BarColor SaddleBrown
  8 + 'EndColor Silver
  9 + 'BackgroundColor Peru
  10 + BackgroundColor<<MODULE>> Orange
  11 + 'BorderColor Peru
  12 + 'FontName Impact
  13 +}
  14 +
  15 +title **Actual scheduling algorithm (general overview)**
  16 +
  17 +(*) --> "Schedule Creation"
  18 + --> if "First Schedule ?" then
  19 + -->[yes] "schedule.plan_night_start = schedule.plan_start"
  20 + --> "Setting of <b>sequences</b> : a list of all the observable sequences" as A2
  21 + else
  22 + -->[no] "<b>Recovery of previous schedule's data:</b>
  23 + EXECUTED sequences, plan_night_start, plan_end
  24 + copy_from_previous_schedule()\l" <<MODULE>>
  25 + endif
  26 + --> A2
  27 + --> "//Add to each sequence its schedule id://
  28 + sequences = [(sequence, shs) for sequence in sequences]"
  29 +
  30 + --> "Creation of the interval [plan_start ; plan_end] \land insertion in the intervals list"
  31 +
  32 + --> "<b>Remove invalid sequences</b>
  33 + bad parameters : jd1 < 0 for example
  34 + removeInvalidSequences()"<<MODULE>>
  35 +
  36 + --> "#TODO <b>Determine priorities according to user and SP</b>"<<MODULE>>
  37 +
  38 + -->"<b>Remove non eligible sequences</b>
  39 + //remove UNPLANNABLE sequences : overlap [jd1; jd2], [plan_start; plan_end] < duration for example//
  40 + removeNonEligibleSequences()" <<MODULE>>
  41 +
  42 + --> "<b>Sort Sequences</b>
  43 + //Sort sequences by priority and soonest jd2//
  44 + sortSequences()"<<MODULE>>
  45 +
  46 + --> "<b>Check Quota</b>
  47 + //Check if the user's quota is sufficient//"
  48 + -->if "Is Quota Sufficient ?" then
  49 + -->[no] "<b>Reject Sequence</b>"
  50 +
  51 + else
  52 + -->[yes]"<b>Get matching intervals</b>
  53 + //Get the matching intervals for the sequence//"
  54 + endif
  55 + -->if "Intervals Found ?" then
  56 + -->[yes] "<b>Place sequence</b>
  57 + placeSequence(sequence, shs, matching)" <<MODULE>>
  58 + --> ==P==
  59 + else
  60 + -->[no] "<b>Try Shifting Sequences</b>
  61 + //Trying to shift the left or/and right sequences//
  62 + //in order to fit the current sequence//" <<MODULE>>
  63 +
  64 + endif
  65 + --> ==P==
  66 +
  67 + --> if "Sequence PLACED ?" then
  68 + -->[yes] "Decrease quota()" <<MODULE>>
  69 + -->"<b>Save Schedule</b>
  70 + //set the sequence's status at PLANNED//
  71 + //and save the new schedule//
  72 + saveSchedule()"<<MODULE>>
  73 + else
  74 + -->[no] "<b>Reject Sequence</b>"
  75 + endif
  76 +
  77 +
  78 +@enduml
0 79 \ No newline at end of file
... ...