Début du rapport
This commit is contained in:
parent
8a0a2352c8
commit
77068bcf89
16 changed files with 339 additions and 2 deletions
|
@ -3,9 +3,9 @@ package InitialSchedules;
|
|||
import org.chocosolver.solver.Model;
|
||||
import org.chocosolver.solver.Solution;
|
||||
import org.chocosolver.solver.constraints.nary.automata.FA.FiniteAutomaton;
|
||||
import org.chocosolver.solver.constraints.nary.automata.FA.IAutomaton;
|
||||
import org.chocosolver.solver.variables.BoolVar;
|
||||
import org.chocosolver.solver.variables.IntVar;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ValidDailySchedules {
|
||||
|
@ -45,10 +45,12 @@ public class ValidDailySchedules {
|
|||
model.arithm(horaire[5], "!=", horaire[12]).post();
|
||||
|
||||
/*Respect du maximum consecutif*/
|
||||
IAutomaton automatonConsecutif = new FiniteAutomaton("[01]*1{" + (nbMaxConsecutif + 1) + "," + nbPeriodes + "}[01]*");
|
||||
FiniteAutomaton automatonConsecutif = new FiniteAutomaton("[01]*1{" + (nbMaxConsecutif + 1) + "," + nbPeriodes + "}[01]*");
|
||||
BoolVar respecteMaxConsecutif = model.regular(horaire, automatonConsecutif).reify();
|
||||
model.arithm(respecteMaxConsecutif, "=", 0).post();
|
||||
|
||||
//System.out.println(automatonConsecutif.toDot());
|
||||
|
||||
/* Trouver les solutions*/
|
||||
List<Solution> solutions = model.getSolver().findAllSolutions();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue