Class ScheduleBuilder
java.lang.Object
org.cswteams.ms3.control.scheduler.ScheduleBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionScheduleBuilder(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) This method has the responsibility to create a new instance of schedule and save it in persistence.ScheduleBuilder(List<Constraint> allConstraints, List<DoctorUffaPriority> allDoctorUffaPriority, Schedule schedule, List<DoctorHolidays> doctorHolidaysList, List<Holiday> holidays) This method has the responsibility of creating a new valid schedule from an existing one -
Method Summary
Modifier and TypeMethodDescriptionaddConcreteShift(ConcreteShift concreteShift, boolean isForced) This method add a concrete shift to the schedule manually.build()
-
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 scheduleendDate- Date of the end of the new scheduleallConstraints- Set of constraints to not be violatedallAssignedShifts- Set of all shifts that are already assigned to a set of peopledoctors- 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 violatedallDoctorUffaPriority- Set of DoctorUffaPriority related to all the doctors that can be added in the scheduleschedule- 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
-
addConcreteShift
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 scheduleisForced- 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
-