package InitialSchedules;

import org.chocosolver.solver.constraints.extension.Tuples;

public class ParametersInitialSchedules {
    
    //mettre les attributs prives et definir accesseurs
    int NbFullTimeSolutions;
    int NbPartTimeSolutions;
    int shiftWorkPerDay;
    int daysPerSchedule;
    int hoursPerWorkPeriod;
    int hourlyRateOfPartTimeEmployees;

    int fixedCostOfPartTimeEmployeesPerSchedule;
    int regularHourlyRateOfPartTimeEmployees;
    int overtimeHourlyRateOfPartTimeEmployees;
    int minWorkingHoursOfPartTimeEmployeesPerSchedule;
    int maxWorkingHoursOfPartTimeEmployeesPerSchedule;
    int maxConsecutiveWorkingHoursOfPartTimeEmployeesPerShiftWork;
    int minConsecutiveNonWorkingHoursBetweenShiftWorksOfPartTimeEmployees;

    int fixedCostOfFullTimeEmployeesPerSchedule;
    int regularHourlyRateOfFullTimeEmployees;
    int overtimeHourlyRateOfFullTimeEmployees;
    int maxWorkingHoursOfFullTimeEmployeesPerSchedule;
    int workingHoursOfFullTimeEmployeesPerSchedule;

    int maxConsecutiveWorkingHoursOfFullTimeEmployeesPerShiftWork;
    int minConsecutiveNonWorkingHoursBetweenShiftWorksOfFullTimeEmployees;

    int workingHoursPaidAtRegularHourlyRatePerSchedule;
    int workingHoursPaidAtRegularHourlyRatePerShiftWork;

    int[] requiredWorkforce;
    Tuples enumerationWorkPeriodsSchedulesOfFullTimeEmployees;
    Tuples enumerationWorkPeriodsSchedulesOfPartTimeEmployees;
    Tuples ValidPartTimeEmployeeShiftTuples;

    public ParametersInitialSchedules() {

        this.setGeneralParameters();
        this.setPartTimeEmployeesParameters();
        this.setFullTimeEmployeesParameters();
        this.setRequiredWorkforce();
        this.setWorkPeriodsSchedulesOfFullTimeEmployees();
        this.setWorkPeriodsSchedulesOfPartTimeEmployees();
        this.setValidPartTimeEmployeeShiftTuples();

    }

    private void setGeneralParameters() {
        this.shiftWorkPerDay = 3;
        this.daysPerSchedule = 14;
        this.hoursPerWorkPeriod = 4;
        this.workingHoursPaidAtRegularHourlyRatePerSchedule = 80;
        this.workingHoursPaidAtRegularHourlyRatePerShiftWork = 8;
    }

    private void setPartTimeEmployeesParameters() {
        this.fixedCostOfPartTimeEmployeesPerSchedule = 50;
        this.regularHourlyRateOfPartTimeEmployees = 12; // To simulate lower productivity
        this.overtimeHourlyRateOfPartTimeEmployees = 17; // To simulate lower productivity
        this.minWorkingHoursOfPartTimeEmployeesPerSchedule = 32;
        this.maxWorkingHoursOfPartTimeEmployeesPerSchedule = 64;
        this.maxConsecutiveWorkingHoursOfPartTimeEmployeesPerShiftWork = 12;
        this.minConsecutiveNonWorkingHoursBetweenShiftWorksOfPartTimeEmployees = 12;
    }

    private void setFullTimeEmployeesParameters() {
        this.fixedCostOfFullTimeEmployeesPerSchedule = 50;
        this.regularHourlyRateOfFullTimeEmployees = 10;
        this.overtimeHourlyRateOfFullTimeEmployees = 15;
        this.workingHoursOfFullTimeEmployeesPerSchedule = 80;
        this.maxWorkingHoursOfFullTimeEmployeesPerSchedule = 120;
        this.maxConsecutiveWorkingHoursOfFullTimeEmployeesPerShiftWork = 12;
        this.minConsecutiveNonWorkingHoursBetweenShiftWorksOfFullTimeEmployees = 12;
    }

    private void setRequiredWorkforce() {

        this.requiredWorkforce = new int[this.daysPerSchedule * this.getWorkPeriodPerDay()];
        int[] dailyRequiredWorkforce = new int[]{2, 2, 4, 4, 3, 3};
        for (int day = 0; day < this.daysPerSchedule; day++) {
            for(int shift = 0; shift < this.getWorkPeriodPerDay(); shift++) {
                this.requiredWorkforce[day * this.getWorkPeriodPerDay() + shift] = dailyRequiredWorkforce[shift];
            }
        }
    }
    
    public int getTotalWorkedPeriodsInSchedule() {
        int totalWorkedPeriodsInSchedule = 0;
        for (int workPeriod = 0 ; workPeriod < this.getWorkPeriodsPerSchedule() ; workPeriod++) {
            totalWorkedPeriodsInSchedule += this.requiredWorkforce[workPeriod];
        }
        return totalWorkedPeriodsInSchedule;
    }


    private void setWorkPeriodsSchedulesOfFullTimeEmployees() {

        ValidDailySchedules validDailyFullTimeSchedules = new ValidDailySchedules(daysPerSchedule,
                10,
                10,
                0,
                5,
                7,
                12,
                4);

        NbFullTimeSolutions = validDailyFullTimeSchedules.getNbSolutions();

        int[][] dailySchedulesOfFullTimeEmployees = validDailyFullTimeSchedules.getValidSchedules();

        int[][] workPeriodsSchedulesOfFullTimeEmployees
                = new int[NbFullTimeSolutions * this.shiftWorkPerDay][this.getWorkPeriodsPerSchedule()];

        // Cette fonction sera a ameliorer avec des sous-fonctions, car elle n'est pas tres explicite.
        for (int scheduleNumber = 0; scheduleNumber < NbFullTimeSolutions; scheduleNumber++) {
            for (int day = 0; day < this.daysPerSchedule; day++) {
                for (int shiftNumber = 0; shiftNumber < this.shiftWorkPerDay; shiftNumber++) {
                    if (dailySchedulesOfFullTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 0) {
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 0;
                    } else if (dailySchedulesOfFullTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 1) {
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 0;
                    } else if (dailySchedulesOfFullTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 2) {
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 1;
                    } else if (dailySchedulesOfFullTimeEmployees[scheduleNumber][day] == 0) {
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 0;
                    }
                }
            }
        }

        // Creation des tuples a partir du tableau pour creer les 3 types de quart de travail (nuit, jour soir).
        this.enumerationWorkPeriodsSchedulesOfFullTimeEmployees
                = new Tuples(workPeriodsSchedulesOfFullTimeEmployees, true);
    }

    private void setWorkPeriodsSchedulesOfPartTimeEmployees() {

        ValidDailySchedules validDailyPartTimeSchedules = new ValidDailySchedules(daysPerSchedule,
                4,
                8,
                0,
                0,
                0,
                0,
                6);

        NbPartTimeSolutions = validDailyPartTimeSchedules.getNbSolutions();

        int[][] dailySchedulesOfPartTimeEmployees = validDailyPartTimeSchedules.getValidSchedules();

        int maxShiftConfig = 5;

        int[][] workPeriodsSchedulesOfPartTimeEmployees
                = new int[NbPartTimeSolutions * 5][this.getWorkPeriodsPerSchedule()];

        // Cette fonction sera a ameliorer avec des sous-fonctions, car elle n'est pas tres explicite.
        for (int scheduleNumber = 0; scheduleNumber < NbPartTimeSolutions; scheduleNumber++) {
            for (int day = 0; day < this.daysPerSchedule; day++) {
                for (int shiftNumber = 0; shiftNumber < maxShiftConfig; shiftNumber++) {
                    if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 0) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 1) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 2) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 3) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 4) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 1;
                    /*} else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 5) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 0] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 6) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 1] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 7) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 2] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 8) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 3] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 9) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 4] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 10) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 5] = 1;*/
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 0) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 0] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 1] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 2] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 3] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 4] = 0;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.getWorkPeriodPerDay() + 5] = 0;
                    }
                }
            }
        }

        // Creation des tuples a partir du tableau pour creer les 3 types de quart de travail (nuit, jour soir).
        this.enumerationWorkPeriodsSchedulesOfPartTimeEmployees
                = new Tuples(workPeriodsSchedulesOfPartTimeEmployees, true);
    }

    private void setValidPartTimeEmployeeShiftTuples() {
        this.ValidPartTimeEmployeeShiftTuples = new ValidPartTimeEmployeeShift().makeTuples();
    }
    
    public int getRequiredWorkForce(int workPeriod) {
        return this.requiredWorkforce[workPeriod];
    }
    
    public int getDaysPerSchedule() {
        return daysPerSchedule;
    }
    
    public int getWorkPeriodsPerSchedule() {
        return this.getWorkPeriodPerDay() * this.daysPerSchedule;
    }
    
    public int getWorkPeriodPerDay() {
        return (int) 24/this.hoursPerWorkPeriod;
    }
    
    public int  getFixedCostOfPartTimeEmployeesPerSchedule() {
        return this.fixedCostOfPartTimeEmployeesPerSchedule;
    }
    
    public int  getFixedCostOfFullTimeEmployeesPerSchedule() {
        return this.fixedCostOfFullTimeEmployeesPerSchedule;
    }

    public int getWorkingPeriodsPaidAtRegularHourlyRatePerSchedule () {
        return (int) (workingHoursPaidAtRegularHourlyRatePerSchedule / this.hoursPerWorkPeriod);
    }

    public int getWorkingPeriodsPaidAtRegularHourlyRatePerShiftWork () {
        return (int) (workingHoursPaidAtRegularHourlyRatePerShiftWork / this.hoursPerWorkPeriod);
    }

    public int getWorkingPeriodCostOfPartTimeEmployeesPaidAtRegularHourlyRate () {
        return (int) (regularHourlyRateOfPartTimeEmployees * this.hoursPerWorkPeriod);
    }

    public int getWorkingPeriodCostOfFullTimeEmployeesPaidAtRegularHourlyRate () {
        return (int) (regularHourlyRateOfFullTimeEmployees * this.hoursPerWorkPeriod);
    }
    
    public int getMinimumWorkingPeriodCost () {
        return (int) (regularHourlyRateOfFullTimeEmployees * this.hoursPerWorkPeriod);
    }

    public int getWorkingPeriodCostOfPartTimeEmployeesPaidAtOvertimeHourlyRate () {
        return (int) (overtimeHourlyRateOfPartTimeEmployees * this.hoursPerWorkPeriod);
    }

    public int getWorkingPeriodCostOfFullTimeEmployeesPaidAtOvertimeHourlyRate () {
        return (int) (overtimeHourlyRateOfFullTimeEmployees * this.hoursPerWorkPeriod);
    }

    public int getMaxConsecutiveWorkingPeriodsOfFullTimeEmployeesPerShiftWork () {
        return (int) (maxConsecutiveWorkingHoursOfFullTimeEmployeesPerShiftWork / this.hoursPerWorkPeriod);
    }

    public int getMaxConsecutiveWorkingPeriodsOfPartTimeEmployeesPerShiftWork () {
        return (int) (maxConsecutiveWorkingHoursOfPartTimeEmployeesPerShiftWork / this.hoursPerWorkPeriod);
    }

    public int getMinConsecutiveNonWorkingPeriodsBetweenShiftWorksOfPartTimeEmployees () {
        return (int) (minConsecutiveNonWorkingHoursBetweenShiftWorksOfPartTimeEmployees / this.hoursPerWorkPeriod);
    }

    public int getMinConsecutiveNonWorkingPeriodsBetweenShiftWorksOfFullTimeEmployees () {
        return (int) (minConsecutiveNonWorkingHoursBetweenShiftWorksOfFullTimeEmployees / this.hoursPerWorkPeriod);
    }

    public int getMaxWorkingPeriodsOfPartTimeEmployeesPerSchedule () {
        return (int) (this.maxWorkingHoursOfPartTimeEmployeesPerSchedule / this.hoursPerWorkPeriod);
    }

    public int getMaxWorkingPeriodsOfFullTimeEmployeesPerSchedule () {
        return (int) (this.maxWorkingHoursOfFullTimeEmployeesPerSchedule / this.hoursPerWorkPeriod);
    }

    public int getMinWorkingPeriodsOfPartTimeEmployeesPerSchedule () {
        return (int) (this.minWorkingHoursOfPartTimeEmployeesPerSchedule / this.hoursPerWorkPeriod);

    }

    public int getWorkingPeriodsOfFullTimeEmployeesPerSchedule () {
        return (int) (this.workingHoursOfFullTimeEmployeesPerSchedule / this.hoursPerWorkPeriod);
    }

    // A implementer plus tard si l'on veut travailler avec des fichiers texte
    public ParametersInitialSchedules(String fileName) {}

}
