From a14e31f97db691a23603cdee842d3ba105b11bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Pelletier?= Date: Mon, 2 Apr 2018 19:41:37 -0400 Subject: [PATCH] Tableau pour les temps partiels --- .../ParametersInitialSchedules.java | 8 ++++---- Travail_de_session/MainClass.java | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Travail_de_session/InitialSchedules/ParametersInitialSchedules.java b/Travail_de_session/InitialSchedules/ParametersInitialSchedules.java index 0e9733c..a021b37 100644 --- a/Travail_de_session/InitialSchedules/ParametersInitialSchedules.java +++ b/Travail_de_session/InitialSchedules/ParametersInitialSchedules.java @@ -158,11 +158,11 @@ public class ParametersInitialSchedules { ValidDailySchedules validDailyPartTimeSchedules = new ValidDailySchedules(daysPerSchedule, 4, - 6, + 8, + 0, + 0, + 0, 0, - 7, - 7, - 14, 6); NbPartTimeSolutions = validDailyPartTimeSchedules.getNbSolutions(); diff --git a/Travail_de_session/MainClass.java b/Travail_de_session/MainClass.java index 152f201..2926276 100644 --- a/Travail_de_session/MainClass.java +++ b/Travail_de_session/MainClass.java @@ -5,6 +5,7 @@ import ScheduleUtil.SchedulesArray; import SchedulesRecovery.RecoveredSchedulesArray; import jdistlib.rng.MersenneTwister; import jdistlib.rng.RandomEngine; +import org.chocosolver.solver.Solution; import org.chocosolver.solver.Solver; import org.chocosolver.solver.exception.ContradictionException; @@ -51,21 +52,21 @@ public class MainClass { solverInitialSchedules.showDashboard(); /*solverInitialSchedules.setSearch(Search.domOverWDegSearch(myModelInitialSchedules.allWorkPeriods));*/ // solverInitialSchedules.setRestartOnSolutions(); /*Sans restart, toutes les horaires sont identiques*/ - //solverInitialSchedules.limitSolution(5); + solverInitialSchedules.limitSolution(5); //solverInitialSchedules.limitTime(10000); - //List myInitialSchedulesSolutions; - //myInitialSchedulesSolutions = solverInitialSchedules.findAllOptimalSolutions - // (myModelInitialSchedules.TotalEmployeesSalary, Model.MINIMIZE); + List myInitialSchedulesSolutions; +/* myInitialSchedulesSolutions = solverInitialSchedules.findAllOptimalSolutions + (myModelInitialSchedules.TotalEmployeesSalary, Model.MINIMIZE);*/ - solverInitialSchedules.findSolution(); - //myInitialSchedulesSolutions = solverInitialSchedules.findAllSolutions(); + //solverInitialSchedules.findSolution(); + myInitialSchedulesSolutions = solverInitialSchedules.findAllSolutions(); solverInitialSchedules.printStatistics(); // Création de l'objet banque d'horaire, qui est une liste d'objets de type InitialSchedulesArray, qui contiennent chacun deux tableaux. - /*for (Solution CurrentSolution : myInitialSchedulesSolutions) { + for (Solution CurrentSolution : myInitialSchedulesSolutions) { SchedulesArray isa = new SchedulesArray(myModelInitialSchedules, CurrentSolution); initialSchedulesArrayList.add(isa); - }*/ + } // Pour afficher les horaires initiales SchedulesWindows.ShowSchedulesFrame intialSchedulesViewer = new SchedulesWindows.ShowSchedulesFrame(initialSchedulesArrayList, "Initial Schedules");