Package org.chocosolver.solver.variables
Interface IVariableFactory
-
- All Known Subinterfaces:
IModel
- All Known Implementing Classes:
Model
public interface IVariableFactory extends ISelf<Model>
Interface to make variables (BoolVar, IntVar, RealVar and SetVar) A kind of factory relying on interface default implementation to allow (multiple) inheritance- Since:
- 4.0.0
- Author:
- Jean-Guillaume FAGES, Charles Prud'homme
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default BoolVarboolVar()Create a boolean variable, i.e. a particular integer variable of domain {0, 1}default BoolVarboolVar(boolean value)Create a constant boolean variable equal to 1 if value is true and 0 otherwisedefault BoolVarboolVar(String name)Create a boolean variabledefault BoolVarboolVar(String name, boolean value)Create a constant boolean variable equal to 1 if value is true and 0 otherwisedefault BoolVar[]boolVarArray(int size)Create an array of size boolean variablesdefault BoolVar[]boolVarArray(String name, int size)Create an array of size boolean variablesdefault BoolVar[][]boolVarMatrix(int dim1, int dim2)Create a dim1*dim2-sized matrix of boolean variablesdefault BoolVar[][]boolVarMatrix(String name, int dim1, int dim2)Create a dim1*dim2-sized matrix of boolean variablesdefault voidcheckIntDomainRange(String NAME, int MIN, int MAX)Checks domain range.default voidcheckRealDomainRange(String NAME, double MIN, double MAX)Checks domain range.default StringgenerateName()Return a generated short string, prefixed withSettings.defaultPrefix()and followed with a single-use number.default StringgenerateName(String prefix)Return a generated short string prefixed with prefix and followed with a single-use number.default IntVarintVar(int value)Create a constant integer variable equal to valuedefault IntVarintVar(int[] values)Create an integer variable of initial domain values.default IntVarintVar(int lb, int ub)Create an integer variable of initial domain [lb, ub] Uses an enumerated domain if ub-lb is small, and a bounded domain otherwisedefault IntVarintVar(int lb, int ub, boolean boundedDomain)Create an integer variable of initial domain [lb, ub]default IntVarintVar(String name, int value)Create a constant integer variable equal to valuedefault IntVarintVar(String name, int[] values)Create an integer variable of initial domain values Uses an enumerated domain that supports holesdefault IntVarintVar(String name, int lb, int ub)Create an integer variable of initial domain [lb, ub] Uses an enumerated domain if ub-lb is small, and a bounded domain otherwisedefault IntVarintVar(String name, int lb, int ub, boolean boundedDomain)Create an integer variable of initial domain [lb, ub]default IntVar[]intVarArray(int size, int[] values)Creates an array of size integer variables, taking their domain in valuesdefault IntVar[]intVarArray(int size, int lb, int ub)Creates an array of size integer variables, taking their domain in [lb, ub]default IntVar[]intVarArray(int size, int lb, int ub, boolean boundedDomain)Creates an array of size integer variables, taking their domain in [lb, ub]default IntVar[]intVarArray(String name, int size, int[] values)Creates an array of size integer variables, taking their domain in valuesdefault IntVar[]intVarArray(String name, int size, int lb, int ub)Creates an array of size integer variables, taking their domain in [lb, ub]default IntVar[]intVarArray(String name, int size, int lb, int ub, boolean boundedDomain)Creates an array of size integer variables, taking their domain in [lb, ub]default IntVar[][]intVarMatrix(int dim1, int dim2, int[] values)Creates a matrix of dim1*dim2 integer variables taking their domain in valuesdefault IntVar[][]intVarMatrix(int dim1, int dim2, int lb, int ub)Creates a matrix of dim1*dim2 integer variables taking their domain in [lb, ub]default IntVar[][]intVarMatrix(int dim1, int dim2, int lb, int ub, boolean boundedDomain)Creates a matrix of dim1*dim2 integer variables taking their domain in [lb, ub]default IntVar[][]intVarMatrix(String name, int dim1, int dim2, int[] values)Creates a matrix of dim1*dim2 integer variables taking their domain in valuesdefault IntVar[][]intVarMatrix(String name, int dim1, int dim2, int lb, int ub)Creates a matrix of dim1*dim2 integer variables taking their domain in [lb, ub]default IntVar[][]intVarMatrix(String name, int dim1, int dim2, int lb, int ub, boolean boundedDomain)Creates a matrix of dim1*dim2 integer variables taking their domain in [lb, ub]default RealVarrealVar(double value)Create a constant real variable equal to valuedefault RealVarrealVar(double value, double precision)Creates a constant real variable equal to valuedefault RealVarrealVar(double lb, double ub, double precision)Creates a real variable, taking its domain in [lb, ub]default RealVarrealVar(String name, double value)Create a constant real variable equal to valuedefault RealVarrealVar(String name, double lb, double ub, double precision)Creates a real variable, taking its domain in [lb, ub]default RealVar[]realVarArray(int size, double lb, double ub, double precision)Creates an array of size real variables, each of domain [lb, ub]default RealVar[]realVarArray(String name, int size, double lb, double ub, double precision)Creates an array of size real variables, each of domain [lb, ub]default RealVar[][]realVarMatrix(int dim1, int dim2, double lb, double ub, double precision)Creates a matrix of dim1*dim2 real variables, each of domain [lb, ub]default RealVar[][]realVarMatrix(String name, int dim1, int dim2, double lb, double ub, double precision)Creates a matrix of dim1*dim2 real variables, each of domain [lb, ub]default SetVarsetVar(int... value)Creates a constant set variable, equal to valuedefault SetVarsetVar(int[] lb, int[] ub)Creates a set variable taking its domain in [lb, ub], For instance [{0,3},{-2,0,2,3}] means the variable must include both 0 and 3 and can additionnaly include -2, and 2default SetVarsetVar(String name, int... value)Creates a constant set variable, equal to valuedefault SetVarsetVar(String name, int[] lb, int[] ub)Creates a set variable taking its domain in [lb, ub], For instance [{0,3},{-2,0,2,3}] means the variable must include both 0 and 3 and can additionnaly include -2, and 2default SetVar[]setVarArray(int size, int[] lb, int[] ub)Creates an array of size set variables, taking their domain in [lb, ub]default SetVar[]setVarArray(String name, int size, int[] lb, int[] ub)Creates an array of size set variables, taking their domain in [lb, ub]default SetVar[][]setVarMatrix(int dim1, int dim2, int[] lb, int[] ub)Creates a matrix of dim1*dim2 set variables, taking their domain in [lb, ub]default SetVar[][]setVarMatrix(String name, int dim1, int dim2, int[] lb, int[] ub)Creates a matrix of dim1*dim2 set variables, taking their domain in [lb, ub]default TasktaskVar(IntVar s, int p)Creates a task variable, based on a starting time s and a processing time p such that: s + p = e, where e is the ending time.default TasktaskVar(IntVar s, IntVar p)Creates a task variable, based on a starting time s and a processing time p such that: s + p = e, where e is the ending time.default TasktaskVar(IntVar s, IntVar p, IntVar e)Creates a task variable, made of a starting time s, a processing time p and an ending time e such that: s + p = e.default Task[]taskVarArray(IntVar[] s, IntVar[] p, IntVar[] e)Creates an array of s.length task variables, where task i is made of a starting time s_i, a processing time p_i and an ending time e_i such that: s_i + p_i = e_i.default Task[][]taskVarMatrix(IntVar[][] s, IntVar[][] p, IntVar[][] e)Creates a matrix of s.length * s_0.length task variables, where task i,j is made of a starting time s_(i,j), a processing time p_(i,j) and an ending time e_(i,j) such that: s_(i,j) + p_(i,j) = e_(i,j).default BoolVar[]toBoolVar(IntVar... ivars)Converts ivars into an array of boolean variables
-
-
-
Field Detail
-
CSTE_NAME
static final String CSTE_NAME
Default prefix for constants- See Also:
- Constant Field Values
-
-
Method Detail
-
boolVar
default BoolVar boolVar(boolean value)
Create a constant boolean variable equal to 1 if value is true and 0 otherwise- Parameters:
value- constant value of the boolean variable (true or false)- Returns:
- a constant of type BoolVar
-
boolVar
default BoolVar boolVar(String name, boolean value)
Create a constant boolean variable equal to 1 if value is true and 0 otherwise- Parameters:
name- name of the variablevalue- constant value of the boolean variable (true or false)- Returns:
- a constant of type BoolVar
-
boolVar
default BoolVar boolVar()
Create a boolean variable, i.e. a particular integer variable of domain {0, 1}- Returns:
- a BoolVar of domain {0, 1}
-
boolVar
default BoolVar boolVar(String name)
Create a boolean variable- Parameters:
name- name of the variable- Returns:
- a BoolVar of domain {0, 1}
-
boolVarArray
default BoolVar[] boolVarArray(int size)
Create an array of size boolean variables- Parameters:
size- number of variable to create- Returns:
- an array of size BoolVar of domain {0, 1}
-
boolVarArray
default BoolVar[] boolVarArray(String name, int size)
Create an array of size boolean variables- Parameters:
name- prefix name of the variables to create. The ith variable will be named name[i]size- number of variable to create- Returns:
- an array of size BoolVar of domain {0, 1}
-
boolVarMatrix
default BoolVar[][] boolVarMatrix(int dim1, int dim2)
Create a dim1*dim2-sized matrix of boolean variables- Parameters:
dim1- number of rows in the matrixdim2- number of columns in the matrix- Returns:
- a matrix of dim1*dim2 BoolVar of domain {0, 1}
-
boolVarMatrix
default BoolVar[][] boolVarMatrix(String name, int dim1, int dim2)
Create a dim1*dim2-sized matrix of boolean variables- Parameters:
name- prefix name of the variables to create. The variable in row i and col j will be named name[i][j]dim1- number of rows in the matrixdim2- number of columns in the matrix- Returns:
- a matrix of dim1*dim2 BoolVar of domain {0, 1}
-
intVar
default IntVar intVar(int value)
Create a constant integer variable equal to value- Parameters:
value- constant value of the variable- Returns:
- a constant IntVar of domain {value}
-
intVar
default IntVar intVar(int[] values)
Create an integer variable of initial domain values. Uses an enumerated domain that supports holes- Parameters:
values- initial domain of the variable- Returns:
- an IntVar of domain values
-
intVar
default IntVar intVar(int lb, int ub)
Create an integer variable of initial domain [lb, ub] Uses an enumerated domain if ub-lb is small, and a bounded domain otherwise- Parameters:
lb- initial domain lower boundub- initial domain upper bound- Returns:
- an IntVar of domain [lb, ub]
-
intVar
default IntVar intVar(int lb, int ub, boolean boundedDomain)
Create an integer variable of initial domain [lb, ub]- Parameters:
lb- initial domain lower boundub- initial domain upper boundboundedDomain- specifies whether to use a bounded domain or an enumerated domain- Returns:
- an IntVar of domain [lb, ub]
-
intVar
default IntVar intVar(String name, int value)
Create a constant integer variable equal to value- Parameters:
name- name of the variablevalue- value of the variable- Returns:
- a constant IntVar of domain {value}
-
intVar
default IntVar intVar(String name, int lb, int ub, boolean boundedDomain)
Create an integer variable of initial domain [lb, ub]- Parameters:
name- name of the variablelb- initial domain lower boundub- initial domain upper boundboundedDomain- specifies whether to use a bounded domain or an enumerated domain- Returns:
- an IntVar of domain [lb, ub]
-
intVar
default IntVar intVar(String name, int lb, int ub)
Create an integer variable of initial domain [lb, ub] Uses an enumerated domain if ub-lb is small, and a bounded domain otherwise- Parameters:
name- name of the variablelb- initial domain lower boundub- initial domain upper bound- Returns:
- an IntVar of domain [lb, ub]
-
intVar
default IntVar intVar(String name, int[] values)
Create an integer variable of initial domain values Uses an enumerated domain that supports holes- Parameters:
name- name of the variablevalues- initial domain- Returns:
- an IntVar of domain values
-
intVarArray
default IntVar[] intVarArray(int size, int[] values)
Creates an array of size integer variables, taking their domain in values- Parameters:
size- number of variablesvalues- initial domain of each variable- Returns:
- an array of size IntVar of domain values
-
intVarArray
default IntVar[] intVarArray(int size, int lb, int ub)
Creates an array of size integer variables, taking their domain in [lb, ub]- Parameters:
size- number of variableslb- initial domain lower bound of each variableub- initial domain upper bound of each variable- Returns:
- an array of size IntVar of domain [lb, ub]
-
intVarArray
default IntVar[] intVarArray(int size, int lb, int ub, boolean boundedDomain)
Creates an array of size integer variables, taking their domain in [lb, ub]- Parameters:
size- number of variableslb- initial domain lower bound of each variableub- initial domain upper bound of each variableboundedDomain- specifies whether to use bounded domains or enumerated domains for each variable- Returns:
- an array of size IntVar of domain [lb, ub]
-
intVarArray
default IntVar[] intVarArray(String name, int size, int lb, int ub, boolean boundedDomain)
Creates an array of size integer variables, taking their domain in [lb, ub]- Parameters:
name- prefix name of the variables to create. The ith variable will be named name[i]size- number of variableslb- initial domain lower bound of each variableub- initial domain upper bound of each variableboundedDomain- specifies whether to use bounded domains or enumerated domains for each variable- Returns:
- an array of size IntVar of domain [lb, ub]
-
intVarArray
default IntVar[] intVarArray(String name, int size, int lb, int ub)
Creates an array of size integer variables, taking their domain in [lb, ub]- Parameters:
name- prefix name of the variables to create. The ith variable will be named name[i]size- number of variableslb- initial domain lower bound of each variableub- initial domain upper bound of each variable- Returns:
- an array of size IntVar of domain [lb, ub]
-
intVarArray
default IntVar[] intVarArray(String name, int size, int[] values)
Creates an array of size integer variables, taking their domain in values- Parameters:
name- prefix name of the variables to create. The ith variable will be named name[i]size- number of variablesvalues- initial domain of each variable- Returns:
- an array of size IntVar of domain values
-
intVarMatrix
default IntVar[][] intVarMatrix(int dim1, int dim2, int[] values)
Creates a matrix of dim1*dim2 integer variables taking their domain in values- Parameters:
dim1- number of rows in the matrixdim2- number of columns in the matrixvalues- initial domain of each variable- Returns:
- a matrix of dim1*dim2 IntVar of domain values
-
intVarMatrix
default IntVar[][] intVarMatrix(int dim1, int dim2, int lb, int ub)
Creates a matrix of dim1*dim2 integer variables taking their domain in [lb, ub]- Parameters:
dim1- number of rows in the matrixdim2- number of columns in the matrixlb- initial domain lower bound of each variableub- initial domain upper bound of each variable- Returns:
- a matrix of dim1*dim2 IntVar of domain [lb, ub]
-
intVarMatrix
default IntVar[][] intVarMatrix(int dim1, int dim2, int lb, int ub, boolean boundedDomain)
Creates a matrix of dim1*dim2 integer variables taking their domain in [lb, ub]- Parameters:
dim1- number of rows in the matrixdim2- number of columns in the matrixlb- initial domain lower bound of each variableub- initial domain upper bound of each variableboundedDomain- specifies whether to use bounded domains or enumerated domains for each variable- Returns:
- a matrix of dim1*dim2 IntVar of domain [lb, ub]
-
intVarMatrix
default IntVar[][] intVarMatrix(String name, int dim1, int dim2, int lb, int ub, boolean boundedDomain)
Creates a matrix of dim1*dim2 integer variables taking their domain in [lb, ub]- Parameters:
name- prefix name of the variables to create. The variable in row i and col j will be named name[i][j]dim1- number of rows in the matrixdim2- number of columns in the matrixlb- initial domain lower bound of each variableub- initial domain upper bound of each variableboundedDomain- specifies whether to use bounded domains or enumerated domains for each variable- Returns:
- a matrix of dim1*dim2 IntVar of domain [lb, ub]
-
intVarMatrix
default IntVar[][] intVarMatrix(String name, int dim1, int dim2, int lb, int ub)
Creates a matrix of dim1*dim2 integer variables taking their domain in [lb, ub]- Parameters:
name- prefix name of the variables to create. The variable in row i and col j will be named name[i][j]dim1- number of rows in the matrixdim2- number of columns in the matrixlb- initial domain lower bound of each variableub- initial domain upper bound of each variable- Returns:
- a matrix of dim1*dim2 IntVar of domain [lb, ub]
-
intVarMatrix
default IntVar[][] intVarMatrix(String name, int dim1, int dim2, int[] values)
Creates a matrix of dim1*dim2 integer variables taking their domain in values- Parameters:
name- prefix name of the variables to create. The variable in row i and col j will be named name[i][j]dim1- number of rows in the matrixdim2- number of columns in the matrixvalues- initial domain of each variable- Returns:
- a matrix of dim1*dim2 IntVar of domain values
-
taskVar
default Task taskVar(IntVar s, int p)
Creates a task variable, based on a starting time s and a processing time p such that: s + p = e, where e is the ending time. A call toTask.ensureBoundConsistency()is required before launching the resolution, this will not be done automatically.- Parameters:
s- integer variable, starting timep- fixed processing time- Returns:
- a task variable.
-
taskVar
default Task taskVar(IntVar s, IntVar p)
Creates a task variable, based on a starting time s and a processing time p such that: s + p = e, where e is the ending time. A call toTask.ensureBoundConsistency()is required before launching the resolution, this will not be done automatically.- Parameters:
s- integer variable, starting timep- fixed processing time- Returns:
- a task variable.
-
taskVar
default Task taskVar(IntVar s, IntVar p, IntVar e)
Creates a task variable, made of a starting time s, a processing time p and an ending time e such that: s + p = e. A call toTask.ensureBoundConsistency()is required before launching the resolution, this will not be done automatically.- Parameters:
s- integer variable, starting timep- integer variable, processing timee- integer variable, ending time- Returns:
- a task variable.
-
taskVarArray
default Task[] taskVarArray(IntVar[] s, IntVar[] p, IntVar[] e)
Creates an array of s.length task variables, where task i is made of a starting time s_i, a processing time p_i and an ending time e_i such that: s_i + p_i = e_i. A call toTask.ensureBoundConsistency()is required before launching the resolution, this will not be done automatically.- Parameters:
s- integer variables, starting timesp- integer variables, processing timese- integer variables, ending times- Returns:
- an array of task variables.
-
taskVarMatrix
default Task[][] taskVarMatrix(IntVar[][] s, IntVar[][] p, IntVar[][] e)
Creates a matrix of s.length * s_0.length task variables, where task i,j is made of a starting time s_(i,j), a processing time p_(i,j) and an ending time e_(i,j) such that: s_(i,j) + p_(i,j) = e_(i,j). A call toTask.ensureBoundConsistency()is required before launching the resolution, this will not be done automatically.- Parameters:
s- integer variables, starting timesp- integer variables, processing timese- integer variables, ending times- Returns:
- a matrix task variable.
-
realVar
default RealVar realVar(double value)
Create a constant real variable equal to value- Parameters:
value- constant value of the variable- Returns:
- a constant RealVar of domain [value,value]
-
realVar
default RealVar realVar(String name, double value)
Create a constant real variable equal to value- Parameters:
name- name of the variablevalue- value of the variable- Returns:
- a constant RealVar of domain [value,value]
-
realVar
default RealVar realVar(double value, double precision)
Creates a constant real variable equal to value- Parameters:
value- constant value of the variableprecision- double precision (e.g., 0.00001d)- Returns:
- a constant RealVar of domain {value}
-
realVar
default RealVar realVar(double lb, double ub, double precision)
Creates a real variable, taking its domain in [lb, ub]- Parameters:
lb- initial domain lower boundub- initial domain upper boundprecision- double precision (e.g., 0.00001d)- Returns:
- a RealVar of domain [lb, ub]
-
realVar
default RealVar realVar(String name, double lb, double ub, double precision)
Creates a real variable, taking its domain in [lb, ub]- Parameters:
name- variable namelb- initial domain lower boundub- initial domain upper boundprecision- double precision (e.g., 0.00001d)- Returns:
- a RealVar of domain [lb, ub]
-
realVarArray
default RealVar[] realVarArray(int size, double lb, double ub, double precision)
Creates an array of size real variables, each of domain [lb, ub]- Parameters:
size- number of variableslb- initial domain lower boundub- initial domain upper boundprecision- double precision (e.g., 0.00001d)- Returns:
- an array of size RealVar of domain [lb, ub]
-
realVarArray
default RealVar[] realVarArray(String name, int size, double lb, double ub, double precision)
Creates an array of size real variables, each of domain [lb, ub]- Parameters:
name- prefix name of the variables to create. The ith variable will be named name[i]size- number of variableslb- initial domain lower boundub- initial domain upper boundprecision- double precision (e.g., 0.00001d)- Returns:
- an array of size RealVar of domain [lb, ub]
-
realVarMatrix
default RealVar[][] realVarMatrix(int dim1, int dim2, double lb, double ub, double precision)
Creates a matrix of dim1*dim2 real variables, each of domain [lb, ub]- Parameters:
dim1- number of matrix rowsdim2- number of matrix columnslb- initial domain lower boundub- initial domain upper boundprecision- double precision (e.g., 0.00001d)- Returns:
- a matrix of dim1*dim2 RealVar of domain [lb, ub]
-
realVarMatrix
default RealVar[][] realVarMatrix(String name, int dim1, int dim2, double lb, double ub, double precision)
Creates a matrix of dim1*dim2 real variables, each of domain [lb, ub]- Parameters:
name- prefix name of the variables to create. The variable in row i and col j will be named name[i][j]dim1- number of matrix rowsdim2- number of matrix columnslb- initial domain lower boundub- initial domain upper boundprecision- double precision (e.g., 0.00001d)- Returns:
- a matrix of dim1*dim2 RealVar of domain [lb, ub]
-
setVar
default SetVar setVar(int[] lb, int[] ub)
Creates a set variable taking its domain in [lb, ub], For instance [{0,3},{-2,0,2,3}] means the variable must include both 0 and 3 and can additionnaly include -2, and 2- Parameters:
lb- initial domain lower bound (contains mandatory elements that should be present in every solution)ub- initial domain upper bound (contains potential elements)- Returns:
- a SetVar of domain [lb, ub]
-
setVar
default SetVar setVar(int... value)
Creates a constant set variable, equal to value- Parameters:
value- value of the set variable, e.g. {0,4,9}- Returns:
- a constant SetVar of domain {value}
-
setVar
default SetVar setVar(String name, int[] lb, int[] ub)
Creates a set variable taking its domain in [lb, ub], For instance [{0,3},{-2,0,2,3}] means the variable must include both 0 and 3 and can additionnaly include -2, and 2- Parameters:
name- name of the variablelb- initial domain lower bound (contains mandatory elements that should be present in every solution)ub- initial domain upper bound (contains potential elements)- Returns:
- a SetVar of domain [lb, ub]
-
setVar
default SetVar setVar(String name, int... value)
Creates a constant set variable, equal to value- Parameters:
name- name of the variablevalue- value of the set variable, e.g. {0,4,9}- Returns:
- a constant SetVar of domain {value}
-
setVarArray
default SetVar[] setVarArray(int size, int[] lb, int[] ub)
Creates an array of size set variables, taking their domain in [lb, ub]- Parameters:
size- number of variableslb- initial domain lower bound of every variable (contains mandatory elements that should be present in every solution)ub- initial domain upper bound of every variable (contains potential elements)- Returns:
- an array of size SetVar of domain [lb, ub]
-
setVarArray
default SetVar[] setVarArray(String name, int size, int[] lb, int[] ub)
Creates an array of size set variables, taking their domain in [lb, ub]- Parameters:
name- prefix name of the variables to create. The ith variable will be named name[i]size- number of variableslb- initial domain lower bound of every variable (contains mandatory elements that should be present in every solution)ub- initial domain upper bound of every variable (contains potential elements)- Returns:
- an array of size SetVar of domain [lb, ub]
-
setVarMatrix
default SetVar[][] setVarMatrix(int dim1, int dim2, int[] lb, int[] ub)
Creates a matrix of dim1*dim2 set variables, taking their domain in [lb, ub]- Parameters:
dim1- number of rows in the matrixdim2- number of columns in the matrixlb- initial domain lower bound of every variable (contains mandatory elements that should be present in every solution)ub- initial domain upper bound of every variable (contains potential elements)- Returns:
- a matrix of dim1*dim2 SetVar of domain [lb, ub]
-
setVarMatrix
default SetVar[][] setVarMatrix(String name, int dim1, int dim2, int[] lb, int[] ub)
Creates a matrix of dim1*dim2 set variables, taking their domain in [lb, ub]- Parameters:
name- prefix name of the variables to create. The variable in row i and col j will be named name[i][j]dim1- number of rows in the matrixdim2- number of columns in the matrixlb- initial domain lower bound of every variable (contains mandatory elements that should be present in every solution)ub- initial domain upper bound of every variable (contains potential elements)- Returns:
- a matrix of dim1*dim2 SetVar of domain [lb, ub]
-
checkIntDomainRange
default void checkIntDomainRange(String NAME, int MIN, int MAX)
Checks domain range. Throws an exception if wrong range definition- Parameters:
NAME- name of the variableMIN- lower bound of the domainMAX- upper bound of the domain
-
checkRealDomainRange
default void checkRealDomainRange(String NAME, double MIN, double MAX)
Checks domain range. Throws an exception if wrong range definition- Parameters:
NAME- name of the variableMIN- lower bound of the domainMAX- upper bound of the domain
-
toBoolVar
default BoolVar[] toBoolVar(IntVar... ivars)
Converts ivars into an array of boolean variables- Parameters:
ivars- an IntVar array containing only boolean variables- Returns:
- an array of BoolVar
- Throws:
ClassCastException- if one variable is not a BoolVar
-
generateName
default String generateName()
Return a generated short string, prefixed withSettings.defaultPrefix()and followed with a single-use number.- Returns:
- generated String to name internally created variables
-
-