Module org.chocosolver.solver
Interface IDecompositionFactory
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
binPackingDec(IntVar[] bin, int[] w, IntVar[] load, int offset)
Creates and posts a decomposition of a bin packing constraint.default void
cumulativeTimeDec(IntVar[] starts, int[] durations, int[] heights, int capacity)
Creates and posts a decomposition of a cumulative constraint: associates a boolean variable to each task and each point of time sich that the scalar product of boolean variables per heights for each time never exceed capacity.default IntVar[]
element(IntVar value, int[][] matrix, IntVar rowIndex, int rowOffset, IntVar colIndex, int colOffset)
Creates an element constraint: value = matrix[rowIndex-offset][colIndex-colOffset]default IntVar[]
element(IntVar value, IntVar[][] matrix, IntVar rowIndex, int rowOffset, IntVar colIndex, int colOffset)
Creates an element constraint: value = matrix[rowIndex-offset][colIndex-colOffset]default IntVar[]
regularDec(IntVar[] vars, IAutomaton automaton)
Creates and posts a decomposition of a regular constraint.
-
-
-
Method Detail
-
cumulativeTimeDec
default void cumulativeTimeDec(IntVar[] starts, int[] durations, int[] heights, int capacity)
Creates and posts a decomposition of a cumulative constraint: associates a boolean variable to each task and each point of time sich that the scalar product of boolean variables per heights for each time never exceed capacity.- Parameters:
starts
- starting time of each taskdurations
- processing time of each taskheights
- resource consumption of each taskcapacity
- resource capacity- See Also:
IIntConstraintFactory.cumulative(IntVar[], int[], int[], int)
-
element
default IntVar[] element(IntVar value, int[][] matrix, IntVar rowIndex, int rowOffset, IntVar colIndex, int colOffset)
Creates an element constraint: value = matrix[rowIndex-offset][colIndex-colOffset]- Parameters:
value
- an integer variable taking its value in matrixmatrix
- a matrix of integer valuesrowIndex
- index of the selected rowrowOffset
- offset for row indexcolIndex
- index of the selected columncolOffset
- offset for column index
-
element
default IntVar[] element(IntVar value, IntVar[][] matrix, IntVar rowIndex, int rowOffset, IntVar colIndex, int colOffset)
Creates an element constraint: value = matrix[rowIndex-offset][colIndex-colOffset]- Parameters:
value
- an integer variable taking its value in matrixmatrix
- a matrix of integer variablesrowIndex
- index of the selected rowrowOffset
- offset for row indexcolIndex
- index of the selected columncolOffset
- offset for column index
-
regularDec
default IntVar[] regularDec(IntVar[] vars, IAutomaton automaton)
Creates and posts a decomposition of a regular constraint. Enforces the sequence of vars to be a word recognized by the deterministic finite automaton. For example regexp = "(1|2)(3*)(4|5)"; The same dfa can be used for different propagators.- Parameters:
vars
- sequence of variablesautomaton
- a deterministic finite automaton defining the regular language- Returns:
- array of variables that encodes the states, which can optionally be constrained too.
-
binPackingDec
default void binPackingDec(IntVar[] bin, int[] w, IntVar[] load, int offset)
Creates and posts a decomposition of a bin packing constraint. Bin Packing formulation: forall b in [0,binLoad.length-1], load[b]=sum(w[i] | i in [0,w.length-1], bin[i] = b+offset) forall i in [0,w.length-1], bin is in [offset,load.length-1+offset],- Parameters:
bin
- IntVar representing the bin of each itemw
- int representing the size of each itemload
- IntVar representing the load of each bin (i.e. the sum of the size of the items in it)offset
- 0 by default but typically 1 if used within MiniZinc (which counts from 1 to n instead of from 0 to n-1)
-
-