Class ScheduleBuilder

java.lang.Object
org.cswteams.ms3.control.scheduler.ScheduleBuilder

public class ScheduleBuilder extends Object
  • Constructor Details

    • ScheduleBuilder

      public ScheduleBuilder(LocalDate startDate, LocalDate endDate, List<Constraint> allConstraints, List<ConcreteShift> allAssignedShifts, List<Doctor> doctors, List<Holiday> holidays, List<DoctorHolidays> doctorHolidaysList, List<DoctorUffaPriority> allDoctorUffaPriority, List<DoctorUffaPrioritySnapshot> snapshot) throws IllegalScheduleException
      This method has the responsibility to create a new instance of schedule and save it in persistence.
      Parameters:
      startDate - Date of the start of the new schedule
      endDate - Date of the end of the new schedule
      allConstraints - Set of constraints to not be violated
      allAssignedShifts - Set of all shifts that are already assigned to a set of people
      doctors - Set of doctors that can be added in the schedule
      Throws:
      IllegalScheduleException - Exception thrown when there are some problems in the configuration parameters of the schedule
    • ScheduleBuilder

      public ScheduleBuilder(List<Constraint> allConstraints, List<DoctorUffaPriority> allDoctorUffaPriority, Schedule schedule, List<DoctorHolidays> doctorHolidaysList, List<Holiday> holidays) throws IllegalScheduleException
      This method has the responsibility of creating a new valid schedule from an existing one
      Parameters:
      allConstraints - Set of constraints to not be violated
      allDoctorUffaPriority - Set of DoctorUffaPriority related to all the doctors that can be added in the schedule
      schedule - An existing schedule from which to start a new one
      Throws:
      IllegalScheduleException - Exception thrown when there are some problems in the configuration parameters of the schedule
  • Method Details

    • build

      public Schedule build()
    • addConcreteShift

      public Schedule addConcreteShift(ConcreteShift concreteShift, boolean isForced)
      This method add a concrete shift to the schedule manually. The concrete shift shall be already defined with date and doctors.
      Parameters:
      concreteShift - The concrete shift to be added to the schedule
      isForced - Boolean that represents if it is possible to violate the soft constraints with the new concrete shift
      Returns:
      An instance of the updated shift schedule