Scheduling.txt 2.43 KB
@startuml

'skinparam backgroundColor #AAFFFF

skinparam activity {
  'StartColor red
  'BarColor SaddleBrown
  'EndColor Silver
  'BackgroundColor Peru
  BackgroundColor<<MODULE>> Orange
  'BorderColor Peru
  'FontName Impact
}

title **Current (2017) scheduling activity diagram (general overview)**

(*) --> "schedule = (Schedule Creation)"
	--> "Set night limits (schedule.plan_start and schedule.plan_end)"
    --> if "First Schedule ?" then
        -->[yes] "schedule.plan_night_start = schedule.plan_start"
        --> "Setting of <b>sequences</b> :  a list of all the observable sequences (from database)" as A2
    else
        -->[no] "<b>Recovery of previous schedule's data:</b>
         EXECUTED sequences, plan_night_start, plan_end
                copy_from_previous_schedule()\l" <<MODULE>>
    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"

    --> "<b>Remove invalid sequences</b>
    bad parameters : jd1 < 0 for example
    removeInvalidSequences()"<<MODULE>>

    --> "// TODO: <b>Determine priorities according to user and SP</b>"<<MODULE>>

    -->"<b>Remove non eligible sequences</b>
    //remove UNPLANNABLE sequences : overlap [jd1; jd2], [plan_start; plan_end] < duration for example//
    removeNonEligibleSequences()" <<MODULE>>

    --> "<b>Sort Sequences</b>
    //Sort sequences by priority and soonest jd2//
    sortSequences()"<<MODULE>>

    --> "<b>Check Quota</b>
    //Check if the user's quota is sufficient//"
    -->if "Is Quota Sufficient ?" then
        -->[no] "<b>Reject Sequence</b>"

    else
        -->[yes]"<b>Get matching intervals</b>
        //Get the matching intervals for the sequence//"
    endif
    -->if "Intervals Found ?" then
     -->[yes] "<b>Place sequence</b>
       placeSequence(sequence, shs, matching)" <<MODULE>>
       --> ==P==
    else
     -->[no] "<b>Try Shifting Sequences</b>
     //Trying to shift the left or/and right sequences//
     //in order to fit the current sequence//" <<MODULE>>

    endif
    --> ==P==

    --> if "Sequence PLACED ?" then
        -->[yes] "Decrease quota()" <<MODULE>>
        -->"<b>Save Schedule</b>
         //set the sequence status to PLANNED//
          //and save the new schedule//
          saveSchedule()"<<MODULE>>
     else
        -->[no] "<b>Reject Sequence</b>"
    endif


@enduml