package AbsenceSchedules;

import InitialSchedules.ModelInitialSchedules;
import ScheduleUtil.SchedulesArray;
import jdistlib.rng.RandomEngine;
import org.chocosolver.solver.Solution;

public class AbsenceSchedulesArray extends SchedulesArray{

    public AbsenceSchedulesArray(SchedulesArray myScheduleArray) {
        super(myScheduleArray);
    } 
    
    public void generateAbsences(RandomEngine r) {
        for (int i = 0; i < this.maxPartTimeEmployee; i++) {
            int[] a = new AbsencesVector(this.workPeriodsPerSchedule, r).getAbsencesVector();
            for (int j = 0; j < this.workPeriodsPerSchedule; j++) {
                this.PartTimeSchedules[i][j] = this.PartTimeSchedules[i][j] * a[j];
            }
        }
        for (int i = 0; i < this.maxFullTimeEmployee; i++) {
            int[] a = new AbsencesVector(this.workPeriodsPerSchedule, r).getAbsencesVector();
            for (int j = 0; j < this.workPeriodsPerSchedule; j++) {
                this.FullTimeSchedules[i][j] = this.FullTimeSchedules[i][j] * a[j];
            }
        }
        updateEmployeesPerWorkPeriod();
        updateWorkingPeriodsPerPartTimeEmployees();
        updateWorkingPeriodsPerFullTimeEmployees();
    }

}