package InitialSchedules;

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

public class ParametersInitialSchedules {

    public int workPeriodsPerDay;
    int NbFullTimeSolutions;
    public int daysPerSchedule;
    public int workPeriodsPerSchedule;
    int totalWorkedPeriodsInSchedule;
    int NbPartTimeSolutions;
    Tuples enumerationWorkPeriodsSchedulesOfPartTimeEmployees;
    int hourlyRateOfPartTimeEmployees;
    private int shiftWorkPerDay;
    private int hoursPerWorkPeriod;
    int minWorkingPeriodsOfPartTimeEmployeesPerSchedule;
    int maxWorkingPeriodsOfPartTimeEmployeesPerSchedule;

    int fixedCostOfFullTimeEmployeesPerSchedule;
    int regularHourlyRateOfFullTimeEmployees;
    int overtimeHourlyRateOfFullTimeEmployees;
    int workingHoursOfFullTimeEmployeesPerSchedule;
    int maxWorkingHoursOfFullTimeEmployeesPerSchedule;
    int workingPeriodsOfFullTimeEmployeesPerSchedule;
    int maxWorkingPeriodsOfFullTimeEmployeesPerSchedule;

    int workingHoursPaidAtRegularHourlyRatePerSchedule;
    private int fixedCostOfPartTimeEmployeesPerSchedule;
    private int minWorkingHoursOfPartTimeEmployeesPerSchedule;

    public int[] requiredWorkforce;
    Tuples enumerationWorkPeriodsSchedulesOfFullTimeEmployees;
    private int maxWorkingHoursOfPartTimeEmployeesPerSchedule;
    private Tuples ValidPartTimeEmployeeShiftTuples;

    public ParametersInitialSchedules() {

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

    }

    private void setGeneralParameters() {
        this.workPeriodsPerDay = 6;
        this.shiftWorkPerDay = 3;
        this.daysPerSchedule = 14;
        this.hoursPerWorkPeriod = 24 / this.workPeriodsPerDay;
        this.workPeriodsPerSchedule = this.workPeriodsPerDay * this.daysPerSchedule;
    }

    private void setPartTimeEmployeesParameters() {
        this.fixedCostOfPartTimeEmployeesPerSchedule = 50;
        this.hourlyRateOfPartTimeEmployees = 12; // To simulate lower productivity
        this.minWorkingHoursOfPartTimeEmployeesPerSchedule = 32;
        this.maxWorkingHoursOfPartTimeEmployeesPerSchedule = 64;
        this.minWorkingPeriodsOfPartTimeEmployeesPerSchedule
                = (int) (this.minWorkingHoursOfPartTimeEmployeesPerSchedule / this.hoursPerWorkPeriod);
        this.maxWorkingPeriodsOfPartTimeEmployeesPerSchedule
                = (int) (this.maxWorkingHoursOfPartTimeEmployeesPerSchedule / this.hoursPerWorkPeriod);
    }

    private void setFullTimeEmployeesParameters() {
        this.fixedCostOfFullTimeEmployeesPerSchedule = 50;
        this.regularHourlyRateOfFullTimeEmployees = 10;
        this.overtimeHourlyRateOfFullTimeEmployees = 15;

        this.workingHoursOfFullTimeEmployeesPerSchedule = 80;
        this.maxWorkingHoursOfFullTimeEmployeesPerSchedule = 120;
        this.workingPeriodsOfFullTimeEmployeesPerSchedule
                = (int) (this.workingHoursOfFullTimeEmployeesPerSchedule / this.hoursPerWorkPeriod);
        this.maxWorkingPeriodsOfFullTimeEmployeesPerSchedule
                = (int) (this.maxWorkingHoursOfFullTimeEmployeesPerSchedule / this.hoursPerWorkPeriod);

        this.workingHoursPaidAtRegularHourlyRatePerSchedule = 80;
    }

    private void setRequiredWorkforce() {

        this.requiredWorkforce = new int[this.daysPerSchedule * this.workPeriodsPerDay];
        this.totalWorkedPeriodsInSchedule = 0;
        int[] dailyRequiredWorkforce = new int[]{2, 2, 3, 3, 1, 1};
        for (int day = 0; day < this.daysPerSchedule; day++) {
            for(int shift = 0; shift < this.workPeriodsPerDay; shift++) {
                this.requiredWorkforce[day * this.workPeriodsPerDay + shift] = dailyRequiredWorkforce[shift];
                this.totalWorkedPeriodsInSchedule += dailyRequiredWorkforce[shift];
            }
        }
    }


    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.workPeriodsPerSchedule];

        // 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.workPeriodsPerDay + 0] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 1] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 2] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 3] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 4] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 5] = 0;
                    } else if (dailySchedulesOfFullTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 1) {
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 0] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 1] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 2] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 3] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 4] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 5] = 0;
                    } else if (dailySchedulesOfFullTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 2) {
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 0] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 1] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 2] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 3] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 4] = 1;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 5] = 1;
                    } else if (dailySchedulesOfFullTimeEmployees[scheduleNumber][day] == 0) {
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 0] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 1] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 2] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 3] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 4] = 0;
                        workPeriodsSchedulesOfFullTimeEmployees[scheduleNumber * this.shiftWorkPerDay + shiftNumber][day * this.workPeriodsPerDay + 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.workPeriodsPerSchedule];

        // 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++) {
                    System.out.println("Schedule:" + scheduleNumber + "day:" + day + "Shift:" + shiftNumber);
                    if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 0) {
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 0] = 1;
                        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 == 1) {
                        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] = 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 == 2) {
                        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] = 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 == 3) {
                        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] = 1;
                        workPeriodsSchedulesOfPartTimeEmployees[scheduleNumber * maxShiftConfig + shiftNumber][day * this.workPeriodsPerDay + 5] = 0;
                    } else if (dailySchedulesOfPartTimeEmployees[scheduleNumber][day] == 1 && shiftNumber == 4) {
                        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] = 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.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] = 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();
    }


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

//		String line = null;
//		try {
//            FileReader fileReader = 
//                new FileReader(fileName);
//
//            BufferedReader bufferedReader = 
//                new BufferedReader(fileReader);
//
//            if((line = bufferedReader.readLine()) != null) {
//            	String[] arrayLine= line.split("\\s+");
//            	PARAMETRES_HORAIRE[0] = Integer.parseInt(arrayLine[0]);
//            	PARAMETRES_HORAIRE[1] = Integer.parseInt(arrayLine[1]);
//            	PARAMETRES_HORAIRE[2] = Integer.parseInt(arrayLine[2]);
//            	PARAMETRES_HORAIRE[3] = Integer.parseInt(arrayLine[3]);
//            }   
//            if((line = bufferedReader.readLine()) != null) {
//            	String[] arrayLine= line.split("\\s+");
//            	for (int i = 0 ; i < p ; i++) {
//            		NBR_EMPLOYES_REQUIS[i] = Integer.parseInt(arrayLine[i]);
//            	}
//            }  
//            if((line = bufferedReader.readLine()) != null) {
//            	String[] arrayLine= line.split("\\s+");
//            	for (int i = 0 ; i < p ; i++) {
//            		NBR_EMPLOYES_SOUHAITES[i] = Integer.parseInt(arrayLine[i]);
//            	}
//            } 
//            bufferedReader.close();         
//        }
//        catch(FileNotFoundException ex) {
//            System.out.println(
//                "Unable to open file '" + 
//                fileName + "'");                
//        }
//        catch(IOException ex) {
//            System.out.println(
//                "Error reading file '" 
//                + fileName + "'");                  
//        }
    }

}
