|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractModel
public abstract class AbstractModel
Field Summary | |
---|---|
protected PartiallyStoredVector |
constraints
All the constraints of the problem. |
protected boolean |
doMaximize
Maximization / Minimization problem |
Constraint |
FALSE
A constant denoting the false constraint (never satisfied) |
protected java.util.ArrayList |
floatVars
All the float vars in the problem. |
protected java.util.ArrayList |
intVars
All the search intVars in the problem. |
protected int |
nbConstraint
The number of constraints for the current problem. |
protected IntVar |
objective
The variable modelling the objective function |
protected java.util.ArrayList |
setVars
All the set intVars in the problem. |
Constraint |
TRUE
A constant denoting the true constraint (always satisfied) |
Constructor Summary | |
---|---|
AbstractModel()
|
Method Summary | |
---|---|
Constraint |
allDifferent(IntVar[] vars)
All different constraints with a global filtering : v1 ! |
Constraint |
allDifferent(IntVar[] vars,
boolean global)
All different constraints : v1 ! |
Constraint |
and(Constraint[] constList)
|
Constraint |
and(Constraint c0,
Constraint c1)
Creates a conjunction from two constraints |
Constraint |
and(Constraint c0,
Constraint c1,
Constraint c2)
|
Constraint |
and(Constraint c0,
Constraint c1,
Constraint c2,
Constraint c3)
|
RealIntervalConstant |
around(double d)
Arounds a double d to [d - epsilon, d + epilon] . |
Constraint |
atleast(Constraint[] constList,
int nbTrueConstraints)
|
Constraint |
atmost(Constraint[] constList,
int nbTrueConstraints)
|
Constraint |
boolChanneling(IntVar b,
IntVar x,
int j)
State a simple channeling bewteen a boolean variable and an interger variable Ensures for that b = 1 iff x = j |
Constraint |
card(Constraint[] constList,
IntVar nbTrueConstraints)
|
RealExp |
cos(RealExp exp)
Cosinus of an expression. |
static int |
countNonNullCoeffs(int[] lcoeffs)
|
protected abstract Constraint |
createAC2001BinConstraint(IntVar v1,
IntVar v2,
BinRelation relation)
|
protected abstract Constraint |
createAC3BinConstraint(IntVar v1,
IntVar v2,
BinRelation relation)
|
protected abstract Constraint |
createAC4BinConstraint(IntVar v1,
IntVar v2,
BinRelation relation)
|
protected abstract Constraint |
createAllDifferent(IntVar[] vars)
|
protected abstract Constraint |
createBinConjunction(Constraint c0,
Constraint c1)
|
protected abstract Constraint |
createBinDisjunction(Constraint c0,
Constraint c1)
|
protected abstract Constraint |
createBoolChanneling(IntVar b,
IntVar x,
int j)
|
protected abstract Constraint |
createBoundAllDiff(IntVar[] vars,
boolean global)
|
protected abstract Constraint |
createCardinality(Constraint[] constList,
IntVar cardVar,
boolean b,
boolean b1)
|
protected abstract Constraint |
createCspLargeConstraint(IntVar[] vs,
LargeRelation relation)
|
protected abstract Constraint |
createCumulative(IntVar[] sts,
IntVar[] ends,
IntVar[] durations,
int[] h,
int capa)
|
protected abstract Constraint |
createDisjoint(SetVar sv1,
SetVar sv2)
|
protected abstract Constraint |
createEqualXC(IntVar v0,
int c)
|
protected abstract Constraint |
createEqualXYC(IntVar intVar,
IntVar intVar1,
int i)
|
protected abstract Constraint |
createEquation(RealVar[] tmpVars,
RealExp exp,
RealIntervalConstant cst)
|
protected abstract Constraint |
createEquiv(Constraint c0,
Constraint c1)
|
protected abstract Constraint |
createGlobalCardinality(IntVar[] vars,
int min,
int max,
int[] low,
int[] up)
|
protected abstract Constraint |
createGreaterOrEqualXC(IntVar v0,
int c)
|
protected abstract Constraint |
createGreaterOrEqualXYC(IntVar intVar,
IntVar intVar1,
int i)
|
protected abstract Constraint |
createGuard(Constraint c0,
Constraint c1)
|
protected abstract Constraint |
createIntLinComb(IntVar[] sortedVars,
int[] sortedCoeffs,
int nbPositiveCoeffs,
int c,
int linOperator)
|
protected abstract IntDomainVar |
createIntVar(java.lang.String name,
int[] sortedValues)
|
protected abstract IntDomainVar |
createIntVar(java.lang.String name,
int domainType,
int min,
int max)
|
protected abstract Constraint |
createInverseChanneling(IntVar[] x,
IntVar[] y)
|
protected abstract Constraint |
createLargeConjunction(Constraint[] alternatives)
|
protected abstract Constraint |
createLargeDisjunction(Constraint[] alternatives)
|
protected abstract Constraint |
createLessOrEqualXC(IntVar v0,
int c)
|
protected abstract Constraint |
createLex(IntVar[] v1,
IntVar[] v2,
boolean strict)
|
protected abstract Constraint |
createMemberX(SetVar sv1,
int val)
|
protected abstract Constraint |
createMemberXY(SetVar sv1,
IntVar var)
|
protected abstract Constraint |
createNotEqualXC(IntVar v0,
int c)
|
protected abstract Constraint |
createNotEqualXYC(IntVar variable,
IntVar variable1,
int i)
|
protected abstract Constraint |
createNotMemberX(SetVar sv1,
int val)
|
protected abstract Constraint |
createNotMemberXY(SetVar sv1,
IntVar var)
|
protected abstract Constraint |
createOccurrence(IntVar[] lvars,
int occval,
boolean onInf,
boolean onSup)
|
protected abstract RealExp |
createRealCos(RealExp exp)
|
protected abstract RealExp |
createRealIntegerPower(RealExp exp,
int power)
|
protected abstract RealIntervalConstant |
createRealIntervalConstant(double a,
double b)
|
protected abstract RealExp |
createRealMinus(RealExp exp1,
RealExp exp2)
|
protected abstract RealExp |
createRealMult(RealExp exp1,
RealExp exp2)
|
protected abstract RealExp |
createRealPlus(RealExp exp1,
RealExp exp2)
|
protected abstract RealExp |
createRealSin(RealExp exp)
|
protected abstract RealVar |
createRealVal(java.lang.String name,
double min,
double max)
|
protected abstract Constraint |
createSetCard(SetVar sv,
IntVar v,
boolean b1,
boolean b2)
|
protected abstract Constraint |
createSetIntersection(SetVar sv1,
SetVar sv2,
SetVar inter)
|
protected abstract SetVar |
createSetVar(java.lang.String name,
int a,
int b)
|
protected abstract Constraint |
createSubscript(IntVar index,
int[] values,
IntVar val,
int offset)
|
protected abstract Constraint |
createSubscript(IntVar index,
IntVar[] varArray,
IntVar val,
int offset)
|
protected abstract Constraint |
createTimesXYZ(IntVar x,
IntVar y,
IntVar z)
|
RealIntervalConstant |
cst(double d)
Makes a constant interval from a double d ([d,d]). |
RealIntervalConstant |
cst(double a,
double b)
Makes a constant interval between two doubles [a,b]. |
Constraint |
cumulative(IntVar[] starts,
IntVar[] ends,
IntVar[] durations,
int[] heights,
int Capa)
Cumulative : Given a set of tasks defined by their starting dates, ending dates, durations and consumptions/heights, the cumulative ensures that at any time t, the sum of the heights of the tasks which are executed at time t does not exceed a given limit C (the capacity of the ressource). |
Constraint |
eq(double cst,
RealExp exp)
|
Constraint |
eq(IntExp x,
int c)
Creates a constraint by stating that a term is equal than a constant |
Constraint |
eq(IntExp x,
IntExp y)
Creates a constraint by stating that a term is equal than a constant |
Constraint |
eq(int c,
IntExp x)
Creates a constraint by stating that a term is equal than a constant |
Constraint |
eq(RealExp exp,
double cst)
|
Constraint |
eq(RealExp exp1,
RealExp exp2)
Eqality constraint. |
Constraint |
eqCard(SetVar sv,
int val)
|
Constraint |
eqCard(SetVar sv,
IntVar v)
|
Constraint |
feasPairAC(IntVar v1,
IntVar v2,
java.util.ArrayList mat)
|
Constraint |
feasPairAC(IntVar v1,
IntVar v2,
java.util.ArrayList mat,
int ac)
|
Constraint |
feasPairAC(IntVar v1,
IntVar v2,
boolean[][] mat)
|
Constraint |
feasPairAC(IntVar v1,
IntVar v2,
boolean[][] mat,
int ac)
|
Constraint |
feasTuple(IntVar[] vars,
java.util.ArrayList tuples)
|
Constraint |
geq(double cst,
RealExp exp)
|
Constraint |
geq(IntExp x,
int c)
Creates a constraint by stating that a term is greater or equal than a constant |
Constraint |
geq(IntExp x,
IntExp y)
Creates a constraint by stating that a variable is greater or equal than a constant |
Constraint |
geq(int c,
IntExp x)
Creates a constraint by stating that a variable is greater or equal than a constant |
Constraint |
geq(RealExp exp,
double cst)
|
Constraint |
geq(RealExp exp1,
RealExp exp2)
Superiority constraint. |
Constraint |
geqCard(SetVar sv,
int val)
|
Constraint |
geqCard(SetVar sv,
IntVar v)
|
IntVar |
getIntVar(int i)
Network management: Retrieve a variable by its index (all integer variables of the problem are numbered in sequence from 0 on) |
int |
getIntVarIndex(IntVar c)
|
int |
getNbIntVars()
retrieving the total number of variables |
int |
getNbRealVars()
Returns the number of variables modelling real numbers. |
int |
getNbSetVars()
Returns the number of variables modelling real numbers. |
RealVar |
getRealVar(int i)
Returns a real variable. |
SetVar |
getSetVar(int i)
Returns a set variable. |
Constraint |
globalCardinality(IntVar[] vars,
int[] low,
int[] up)
Global cardinality : Given an array of variables vars such that their domains are subsets of [1, n], the constraint ensures that the number of occurences of the value i among the variables is between low[i - 1] and up[i - 1]. |
Constraint |
globalCardinality(IntVar[] vars,
int min,
int max,
int[] low,
int[] up)
Global cardinality : Given an array of variables vars, min the minimal value over all variables, and max the maximal value over all variables, the constraint ensures that the number of occurences of the value i among the variables is between low[i - min] and up[i - min]. |
Constraint |
gt(IntExp x,
int c)
Creates a constraint by stating that a variable is strictly than a constant |
Constraint |
gt(IntExp x,
IntExp y)
Creates a constraint by stating that a variable is strictly than a constant |
Constraint |
gt(int c,
IntExp x)
Creates a constraint by stating that a variable is strictly than a constant |
Constraint |
ifOnlyIf(Constraint c1,
Constraint c2)
Creates an equivalence from two constraints |
Constraint |
ifThen(Constraint c1,
Constraint c2)
Creates a lazy implication from two constraints |
Constraint |
implies(Constraint c1,
Constraint c2)
Creates an implication from two constraints |
Constraint |
infeasPairAC(IntVar v1,
IntVar v2,
java.util.ArrayList mat)
|
Constraint |
infeasPairAC(IntVar v1,
IntVar v2,
java.util.ArrayList mat,
int ac)
|
Constraint |
infeasPairAC(IntVar v1,
IntVar v2,
boolean[][] mat)
|
Constraint |
infeasPairAC(IntVar v1,
IntVar v2,
boolean[][] mat,
int ac)
|
Constraint |
infeasTuple(IntVar[] vars,
java.util.ArrayList tuples)
|
Constraint |
inverseChanneling(IntVar[] x,
IntVar[] y)
State a channeling bewteen two arrays of integer variables x and y with the same domain which enforces x[i] = j <=> y[j] = i |
Constraint |
leq(double cst,
RealExp exp)
|
Constraint |
leq(IntExp x,
int c)
Creates a constraint by stating that integer expression is less or equal than a constant |
Constraint |
leq(IntExp x,
IntExp y)
Creates a constraint by stating that an integer expression is less or equal than another one |
Constraint |
leq(int c,
IntExp x)
Creates a constraint by stating that a constant is less or equal than an integer expression |
Constraint |
leq(RealExp exp,
double cst)
|
Constraint |
leq(RealExp exp1,
RealExp exp2)
Inferority constraint. |
Constraint |
leqCard(SetVar sv,
int val)
|
Constraint |
leqCard(SetVar sv,
IntVar v)
|
Constraint |
lex(IntVar[] v1,
IntVar[] v2)
Enforce a strict lexicographic ordering on two vectors of integer variables x <_lex y with x = |
Constraint |
lexeq(IntVar[] v1,
IntVar[] v2)
Enforce a lexicographic ordering on two vectors of integer variables x <_lex y with x = |
Constraint |
lt(IntExp x,
int c)
Creates a constraint by stating that integer expression is strictly less than a constant |
Constraint |
lt(IntExp x,
IntExp y)
Creates a constraint by stating that an integer expression is strictly less than another one |
Constraint |
lt(int c,
IntExp x)
Creates a constraint by stating that a constant is strictly less than an integer expression |
IntDomainVar |
makeBoundIntVar(java.lang.String name,
int min,
int max)
Creates a new search variable with an interval domain |
IntDomainVar |
makeBoundIntVar(java.lang.String name,
int min,
int max,
boolean toAdd)
|
IntDomainVar[] |
makeBoundIntVarArray(java.lang.String name,
int dim,
int min,
int max)
Creates a one dimensional array of integer variables |
IntDomainVar[][] |
makeBoundIntVarArray(java.lang.String name,
int dim1,
int dim2,
int min,
int max)
Creates a one dimensional array of integer variables |
Constraint |
makeConjunction(Constraint[] branches)
|
IntVar |
makeConstantIntVar(int val)
Creates an unnamed instantiated variable |
IntVar |
makeConstantIntVar(java.lang.String name,
int val)
Creates an instantiated variable |
Constraint |
makeDisjunction(Constraint[] alternatives)
|
IntDomainVar |
makeEnumIntVar(java.lang.String name,
int[] values)
Creates a new search variable with an enumerated domain |
IntDomainVar |
makeEnumIntVar(java.lang.String name,
int min,
int max)
Creates a new search variable with an enumerated domain |
IntDomainVar[] |
makeEnumIntVarArray(java.lang.String name,
int dim,
int min,
int max)
Creates a one dimensional array of integer variables |
IntDomainVar[][] |
makeEnumIntVarArray(java.lang.String name,
int dim1,
int dim2,
int min,
int max)
Creates a one dimensional array of integer variables |
Constraint |
makeEquation(RealExp exp,
RealIntervalConstant cst)
Makes an equation from an expression and a constantt interval. |
protected Constraint |
makeIntLinComb(IntVar[] lvars,
int[] lcoeffs,
int c,
int linOperator)
|
protected Constraint |
makeOccurrence(IntVar[] lvars,
IntVar occVar,
int occval,
boolean onInf,
boolean onSup)
|
protected Constraint |
makePairAC(IntVar v1,
IntVar v2,
java.util.ArrayList mat,
boolean feas,
int ac)
|
protected Constraint |
makePairAC(IntVar v1,
IntVar v2,
boolean[][] mat,
boolean feas,
int ac)
|
RealVar |
makeRealVar(double inf,
double sup)
Creates an anonymous real variable. |
RealVar |
makeRealVar(java.lang.String name)
Creates an unbounded real variable. |
RealVar |
makeRealVar(java.lang.String name,
double min,
double max)
Creates a real variable. |
SetVar |
makeSetVar(java.lang.String name,
int a,
int b)
Creates a set variable. |
Constraint |
makeTupleFC(IntVar[] vs,
java.util.ArrayList tuples,
boolean feas)
|
Constraint |
member(int val,
SetVar sv1)
|
Constraint |
member(IntVar var,
SetVar sv1)
|
Constraint |
member(SetVar sv1,
int val)
|
Constraint |
member(SetVar sv1,
IntVar var)
|
IntExp |
minus(IntExp t,
int c)
Subtracting an search constant from an expression |
IntExp |
minus(IntExp t1,
IntExp t2)
Subtracting two terms one from another |
IntExp |
minus(int c,
IntExp t)
Subtracting an expression from an search |
RealExp |
minus(RealExp exp1,
RealExp exp2)
Substraction of two expressions. |
IntExp |
mult(int a,
IntExp x)
Creates a simple linear term from one coefficient and one variable |
RealExp |
mult(RealExp exp1,
RealExp exp2)
Multiplication of two expressions. |
Constraint |
neq(IntExp x,
int c)
Creates a constraint by stating that a term is not equal than a constant |
Constraint |
neq(IntExp x,
IntExp y)
Creates a constraint by stating that two term are different |
Constraint |
neq(int c,
IntExp x)
Creates a constraint by stating that a term is not equal than a constant |
Constraint |
not(Constraint c)
Creates the logical opposite of a constraint |
Constraint |
notMember(int val,
SetVar sv1)
|
Constraint |
notMember(IntVar var,
SetVar sv1)
|
Constraint |
notMember(SetVar sv1,
int val)
|
Constraint |
notMember(SetVar sv1,
IntVar var)
|
Constraint |
nth(IntVar index,
int[] values,
IntVar val)
subscript constraint: accessing an array with a variable index |
Constraint |
nth(IntVar index,
IntVar[] varArray,
IntVar val)
subscript constraint: accessing an array of variables with a variable index |
Constraint |
occurenceMax(IntVar[] vars,
int value,
IntVar occurrence)
Ensures that the upper bound of occurrence is at most equal to the number of occurences size{forall v in vars | v = value} >= occurence |
Constraint |
occurenceMin(IntVar[] vars,
int value,
IntVar occurrence)
Ensures that the lower bound of occurrence is at least equal to the number of occurences size{forall v in vars | v = value} <= occurence |
Constraint |
occurrence(IntVar[] vars,
int value,
IntVar occurrence)
Ensures that the occurrence variable contains the number of occurrences of the given value in the list of variables |
Constraint |
or(Constraint[] constList)
|
Constraint |
or(Constraint c0,
Constraint c1)
Creates a disjunction from two constraints |
Constraint |
or(Constraint c0,
Constraint c1,
Constraint c2)
|
Constraint |
or(Constraint c0,
Constraint c1,
Constraint c2,
Constraint c3)
|
protected IntExp |
plus(int[] coeffs1,
IntVar[] vars1,
int cste1,
int[] coeffs2,
IntVar[] vars2,
int cste2)
Utility method for constructing a term from two lists of variables, list of coeffcicients and constants |
IntExp |
plus(IntExp t,
int c)
Adding an search constant to an expression |
IntExp |
plus(IntExp t1,
IntExp t2)
Adding two terms one to another |
IntExp |
plus(int c,
IntExp t1)
Adding an search constant to an expression |
RealExp |
plus(RealExp exp1,
RealExp exp2)
Addition of two expressions. |
RealExp |
power(RealExp exp,
int power)
Power of an expression. |
Constraint |
relationPairAC(IntVar v1,
IntVar v2,
BinRelation binR)
|
Constraint |
relationPairAC(IntVar v1,
IntVar v2,
BinRelation binR,
int ac)
|
Constraint |
relationTuple(IntVar[] vs,
LargeRelation rela)
|
IntExp |
scalar(int[] lc,
IntVar[] lv)
Building a term from a scalar product of coefficients and variables |
IntExp |
scalar(IntVar[] lv,
int[] lc)
Building a term from a scalar product of coefficients and variables |
Constraint |
setDisjoint(SetVar sv1,
SetVar sv2)
|
Constraint |
setInter(SetVar sv1,
SetVar sv2,
SetVar inter)
Enforce a set to be the intersection of two others. |
void |
setMaximizationObjective(IntVar obj)
sets the optimization mode to maximization and sets the objective function |
void |
setMinimizationObjective(IntVar obj)
sets the optimization mode to minimization and sets the objective function |
RealExp |
sin(RealExp exp)
Sinus of an expression. |
IntExp |
sum(IntExp[] lv)
Building a term from a sum of integer expressions |
Constraint |
times(IntVar x,
IntVar y,
IntVar z)
Creates a constraint by stating that X*Y=Z |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Constraint TRUE
public final Constraint FALSE
protected PartiallyStoredVector constraints
protected java.util.ArrayList intVars
protected java.util.ArrayList setVars
protected java.util.ArrayList floatVars
protected IntVar objective
protected boolean doMaximize
protected int nbConstraint
Constructor Detail |
---|
public AbstractModel()
Method Detail |
---|
public IntDomainVar makeEnumIntVar(java.lang.String name, int min, int max)
makeEnumIntVar
in interface IntModeler
name
- the name of the variablemin
- minimal allowed value (included in the domain)max
- maximal allowed value (included in the domain)
public IntDomainVar makeEnumIntVar(java.lang.String name, int[] values)
name
- the name of the variablevalues
- allowed in the domain (may be unsorted, but not with duplicates !)
public IntDomainVar makeBoundIntVar(java.lang.String name, int min, int max)
makeBoundIntVar
in interface IntModeler
name
- the name of the variablemin
- minimal allowed value (included in the domain)max
- maximal allowed value (included in the domain)
public IntDomainVar makeBoundIntVar(java.lang.String name, int min, int max, boolean toAdd)
public final void setMinimizationObjective(IntVar obj)
IntModeler
setMinimizationObjective
in interface IntModeler
obj
- the variable to be minimizedpublic final void setMaximizationObjective(IntVar obj)
IntModeler
setMaximizationObjective
in interface IntModeler
obj
- the variable to be maximizedpublic IntDomainVar[] makeBoundIntVarArray(java.lang.String name, int dim, int min, int max)
makeBoundIntVarArray
in interface IntModeler
name
- the name of the array (a prefix shared by all individual IntVars)dim
- the number of entriesmin
- the minimal domain value for all variables in the arraymax
- the maximal domain value for all variables in the arraypublic IntDomainVar[][] makeBoundIntVarArray(java.lang.String name, int dim1, int dim2, int min, int max)
makeBoundIntVarArray
in interface IntModeler
name
- the name of the array (a prefix shared by all individual IntVars)dim1
- the number of entries for the first indexdim2
- the number of entries for the second indexmin
- the minimal domain value for all variables in the arraymax
- the maximal domain value for all variables in the arraypublic IntDomainVar[] makeEnumIntVarArray(java.lang.String name, int dim, int min, int max)
name
- the name of the array (a prefix shared by all individual IntVars)dim
- the number of entriesmin
- the minimal domain value for all variables in the arraymax
- the maximal domain value for all variables in the arraypublic IntDomainVar[][] makeEnumIntVarArray(java.lang.String name, int dim1, int dim2, int min, int max)
name
- the name of the array (a prefix shared by all individual IntVars)dim1
- the number of entries for the first indexdim2
- the number of entries for the second indexmin
- the minimal domain value for all variables in the arraymax
- the maximal domain value for all variables in the arraypublic RealVar makeRealVar(java.lang.String name, double min, double max)
name
- min
- max
-
public RealVar makeRealVar(double inf, double sup)
public RealVar makeRealVar(java.lang.String name)
public SetVar makeSetVar(java.lang.String name, int a, int b)
name
- a
- : the first value of the initial enveloppeb
- : the last value of the initial enveloppe
public IntVar makeConstantIntVar(java.lang.String name, int val)
IntModeler
makeConstantIntVar
in interface IntModeler
name
- the name of the variableval
- the value
public IntVar makeConstantIntVar(int val)
IntModeler
makeConstantIntVar
in interface IntModeler
val
- the value
public IntExp mult(int a, IntExp x)
mult
in interface IntModeler
a
- the coefficientx
- the variable
protected IntExp plus(int[] coeffs1, IntVar[] vars1, int cste1, int[] coeffs2, IntVar[] vars2, int cste2)
coeffs1
- coefficients from the first termvars1
- variables from the first termcste1
- constant from the fisrt termcoeffs2
- coefficients from the second termvars2
- variables from the second termcste2
- constant from the second term
public IntExp plus(IntExp t1, IntExp t2)
plus
in interface IntModeler
t1
- first termt2
- second term
public IntExp plus(IntExp t, int c)
IntModeler
plus
in interface IntModeler
t
- the expressionc
- the search constant
public final IntExp plus(int c, IntExp t1)
IntModeler
plus
in interface IntModeler
c
- the search constantt1
- the expression
public IntExp minus(IntExp t1, IntExp t2)
minus
in interface IntModeler
t1
- first termt2
- second term
public IntExp minus(IntExp t, int c)
IntModeler
minus
in interface IntModeler
t
- the expressionc
- the search constant
public IntExp minus(int c, IntExp t)
IntModeler
minus
in interface IntModeler
c
- the search constantt
- the expression
public IntExp scalar(int[] lc, IntVar[] lv)
scalar
in interface IntModeler
lc
- the array of coefficientslv
- the array of variables
public final IntExp scalar(IntVar[] lv, int[] lc)
scalar
in interface IntModeler
lv
- the array of variableslc
- the array of coefficients
public IntExp sum(IntExp[] lv)
sum
in interface IntModeler
lv
- the array of integer expressions
public Constraint neq(IntExp x, int c)
neq
in interface IntModeler
x
- the expressionc
- the constant
public final Constraint neq(int c, IntExp x)
IntModeler
neq
in interface IntModeler
c
- the search constantx
- the search expression
public Constraint neq(IntExp x, IntExp y)
IntModeler
neq
in interface IntModeler
x
- the first variabley
- the second variale
public Constraint geq(IntExp x, IntExp y)
IntModeler
geq
in interface IntModeler
x
- the first search expressiony
- the second search expression
public static int countNonNullCoeffs(int[] lcoeffs)
protected Constraint makeIntLinComb(IntVar[] lvars, int[] lcoeffs, int c, int linOperator)
public Constraint geq(IntExp x, int c)
geq
in interface IntModeler
x
- the expressionc
- the constant
public Constraint geq(int c, IntExp x)
IntModeler
geq
in interface IntModeler
c
- the search constantx
- the search expression
public final Constraint gt(IntExp x, IntExp y)
IntModeler
gt
in interface IntModeler
x
- the first search expressiony
- the second search expression
public final Constraint gt(IntExp x, int c)
IntModeler
gt
in interface IntModeler
x
- the search expressionc
- the search constant
public final Constraint gt(int c, IntExp x)
IntModeler
gt
in interface IntModeler
c
- the search constantx
- the search expression
public Constraint eq(IntExp x, IntExp y)
IntModeler
eq
in interface IntModeler
x
- the first search expressiony
- the second search expression
public Constraint eq(IntExp x, int c)
IntModeler
eq
in interface IntModeler
x
- the search expressionc
- the search constant
public final Constraint eq(int c, IntExp x)
IntModeler
eq
in interface IntModeler
c
- the search constantx
- the search expression
public final Constraint leq(IntExp x, int c)
IntModeler
leq
in interface IntModeler
x
- the search expressionc
- the search constant
public final Constraint leq(int c, IntExp x)
IntModeler
leq
in interface IntModeler
c
- the search constantx
- the search expression
public final Constraint leq(IntExp x, IntExp y)
IntModeler
leq
in interface IntModeler
x
- the first search expressiony
- the second search expression
public final Constraint lt(IntExp x, int c)
IntModeler
lt
in interface IntModeler
x
- the search expressionc
- the search constant
public final Constraint lt(int c, IntExp x)
IntModeler
lt
in interface IntModeler
c
- the search constantx
- the search expression
public final Constraint lt(IntExp x, IntExp y)
IntModeler
lt
in interface IntModeler
x
- the first search expressiony
- the second search expression
public Constraint times(IntVar x, IntVar y, IntVar z)
IntModeler
times
in interface IntModeler
x
- the first operand of the multiplicationy
- the second operand of the multiplicationz
- the result of the multiplication
public Constraint makeEquation(RealExp exp, RealIntervalConstant cst)
exp
- The expressioncst
- The interval this expression should be inpublic Constraint eq(RealExp exp1, RealExp exp2)
public Constraint eq(RealExp exp, double cst)
public Constraint eq(double cst, RealExp exp)
public Constraint leq(RealExp exp1, RealExp exp2)
public Constraint leq(RealExp exp, double cst)
public Constraint leq(double cst, RealExp exp)
public Constraint geq(RealExp exp1, RealExp exp2)
public Constraint geq(RealExp exp, double cst)
public Constraint geq(double cst, RealExp exp)
public RealExp plus(RealExp exp1, RealExp exp2)
public RealExp minus(RealExp exp1, RealExp exp2)
public RealExp mult(RealExp exp1, RealExp exp2)
public RealExp power(RealExp exp, int power)
public RealExp cos(RealExp exp)
public RealExp sin(RealExp exp)
public RealIntervalConstant around(double d)
[d - epsilon, d + epilon]
.
public RealIntervalConstant cst(double d)
public RealIntervalConstant cst(double a, double b)
public Constraint makeDisjunction(Constraint[] alternatives)
public final Constraint or(Constraint[] constList)
public final Constraint or(Constraint c0, Constraint c1, Constraint c2)
public final Constraint or(Constraint c0, Constraint c1, Constraint c2, Constraint c3)
public final Constraint or(Constraint c0, Constraint c1)
BoolModeler
or
in interface BoolModeler
c0
- the first branchc1
- the second branch
public Constraint makeConjunction(Constraint[] branches)
public final Constraint and(Constraint[] constList)
public final Constraint and(Constraint c0, Constraint c1, Constraint c2)
public final Constraint and(Constraint c0, Constraint c1, Constraint c2, Constraint c3)
public final Constraint and(Constraint c0, Constraint c1)
BoolModeler
and
in interface BoolModeler
c0
- the first branchc1
- the second branch
public final Constraint implies(Constraint c1, Constraint c2)
BoolModeler
implies
in interface BoolModeler
c1
- the condition constraintc2
- the conclusion constraint
public Constraint ifThen(Constraint c1, Constraint c2)
BoolModeler
ifThen
in interface BoolModeler
c1
- the condition constraintc2
- the conclusion constraint
public Constraint ifOnlyIf(Constraint c1, Constraint c2)
BoolModeler
ifOnlyIf
in interface BoolModeler
c1
- the first branchc2
- the second branch
public final Constraint not(Constraint c)
BoolModeler
not
in interface BoolModeler
c
- the constraint to be negated
public Constraint atleast(Constraint[] constList, int nbTrueConstraints)
public Constraint atmost(Constraint[] constList, int nbTrueConstraints)
public Constraint card(Constraint[] constList, IntVar nbTrueConstraints)
protected Constraint makePairAC(IntVar v1, IntVar v2, java.util.ArrayList mat, boolean feas, int ac)
protected Constraint makePairAC(IntVar v1, IntVar v2, boolean[][] mat, boolean feas, int ac)
public Constraint relationPairAC(IntVar v1, IntVar v2, BinRelation binR, int ac)
public Constraint makeTupleFC(IntVar[] vs, java.util.ArrayList tuples, boolean feas)
public Constraint relationTuple(IntVar[] vs, LargeRelation rela)
public Constraint infeasTuple(IntVar[] vars, java.util.ArrayList tuples)
public Constraint feasTuple(IntVar[] vars, java.util.ArrayList tuples)
public Constraint relationPairAC(IntVar v1, IntVar v2, BinRelation binR)
public Constraint infeasPairAC(IntVar v1, IntVar v2, java.util.ArrayList mat)
public Constraint infeasPairAC(IntVar v1, IntVar v2, java.util.ArrayList mat, int ac)
public Constraint feasPairAC(IntVar v1, IntVar v2, java.util.ArrayList mat)
public Constraint feasPairAC(IntVar v1, IntVar v2, java.util.ArrayList mat, int ac)
public Constraint infeasPairAC(IntVar v1, IntVar v2, boolean[][] mat)
public Constraint infeasPairAC(IntVar v1, IntVar v2, boolean[][] mat, int ac)
public Constraint feasPairAC(IntVar v1, IntVar v2, boolean[][] mat)
public Constraint feasPairAC(IntVar v1, IntVar v2, boolean[][] mat, int ac)
protected Constraint makeOccurrence(IntVar[] lvars, IntVar occVar, int occval, boolean onInf, boolean onSup)
public Constraint occurrence(IntVar[] vars, int value, IntVar occurrence)
vars
- List of variables where the value can appearoccurrence
- The variable that should contain the occurence numberpublic Constraint occurenceMin(IntVar[] vars, int value, IntVar occurrence)
public Constraint occurenceMax(IntVar[] vars, int value, IntVar occurrence)
public Constraint nth(IntVar index, int[] values, IntVar val)
public Constraint nth(IntVar index, IntVar[] varArray, IntVar val)
public Constraint boolChanneling(IntVar b, IntVar x, int j)
b
- : a boolean variablex
- : an integer variablej
- : the value such that b = 1 ssi x = j, and b = 0 otherwisepublic Constraint inverseChanneling(IntVar[] x, IntVar[] y)
public Constraint allDifferent(IntVar[] vars)
public Constraint allDifferent(IntVar[] vars, boolean global)
public Constraint globalCardinality(IntVar[] vars, int min, int max, int[] low, int[] up)
public Constraint globalCardinality(IntVar[] vars, int[] low, int[] up)
public Constraint cumulative(IntVar[] starts, IntVar[] ends, IntVar[] durations, int[] heights, int Capa)
public Constraint lexeq(IntVar[] v1, IntVar[] v2)
public Constraint lex(IntVar[] v1, IntVar[] v2)
public Constraint setInter(SetVar sv1, SetVar sv2, SetVar inter)
inter
- the intersection of sv1 and sv2public Constraint eqCard(SetVar sv, IntVar v)
public Constraint eqCard(SetVar sv, int val)
public Constraint geqCard(SetVar sv, IntVar v)
public Constraint geqCard(SetVar sv, int val)
public Constraint leqCard(SetVar sv, IntVar v)
public Constraint leqCard(SetVar sv, int val)
public Constraint setDisjoint(SetVar sv1, SetVar sv2)
public Constraint member(int val, SetVar sv1)
public Constraint member(SetVar sv1, int val)
public Constraint member(SetVar sv1, IntVar var)
public Constraint member(IntVar var, SetVar sv1)
public Constraint notMember(int val, SetVar sv1)
public Constraint notMember(SetVar sv1, int val)
public Constraint notMember(SetVar sv1, IntVar var)
public Constraint notMember(IntVar var, SetVar sv1)
protected abstract Constraint createEqualXC(IntVar v0, int c)
protected abstract Constraint createNotEqualXC(IntVar v0, int c)
protected abstract Constraint createGreaterOrEqualXC(IntVar v0, int c)
protected abstract Constraint createLessOrEqualXC(IntVar v0, int c)
protected abstract Constraint createEqualXYC(IntVar intVar, IntVar intVar1, int i)
protected abstract Constraint createNotEqualXYC(IntVar variable, IntVar variable1, int i)
protected abstract Constraint createGreaterOrEqualXYC(IntVar intVar, IntVar intVar1, int i)
protected abstract Constraint createIntLinComb(IntVar[] sortedVars, int[] sortedCoeffs, int nbPositiveCoeffs, int c, int linOperator)
protected abstract Constraint createTimesXYZ(IntVar x, IntVar y, IntVar z)
protected abstract Constraint createBinDisjunction(Constraint c0, Constraint c1)
protected abstract Constraint createLargeDisjunction(Constraint[] alternatives)
protected abstract Constraint createBinConjunction(Constraint c0, Constraint c1)
protected abstract Constraint createLargeConjunction(Constraint[] alternatives)
protected abstract Constraint createCardinality(Constraint[] constList, IntVar cardVar, boolean b, boolean b1)
protected abstract Constraint createGuard(Constraint c0, Constraint c1)
protected abstract Constraint createEquiv(Constraint c0, Constraint c1)
protected abstract Constraint createAC3BinConstraint(IntVar v1, IntVar v2, BinRelation relation)
protected abstract Constraint createAC4BinConstraint(IntVar v1, IntVar v2, BinRelation relation)
protected abstract Constraint createAC2001BinConstraint(IntVar v1, IntVar v2, BinRelation relation)
protected abstract Constraint createCspLargeConstraint(IntVar[] vs, LargeRelation relation)
protected abstract Constraint createOccurrence(IntVar[] lvars, int occval, boolean onInf, boolean onSup)
protected abstract Constraint createAllDifferent(IntVar[] vars)
protected abstract Constraint createBoundAllDiff(IntVar[] vars, boolean global)
protected abstract Constraint createGlobalCardinality(IntVar[] vars, int min, int max, int[] low, int[] up)
protected abstract Constraint createCumulative(IntVar[] sts, IntVar[] ends, IntVar[] durations, int[] h, int capa)
protected abstract Constraint createLex(IntVar[] v1, IntVar[] v2, boolean strict)
protected abstract Constraint createSubscript(IntVar index, int[] values, IntVar val, int offset)
protected abstract Constraint createSubscript(IntVar index, IntVar[] varArray, IntVar val, int offset)
protected abstract Constraint createInverseChanneling(IntVar[] x, IntVar[] y)
protected abstract Constraint createBoolChanneling(IntVar b, IntVar x, int j)
protected abstract IntDomainVar createIntVar(java.lang.String name, int domainType, int min, int max)
protected abstract IntDomainVar createIntVar(java.lang.String name, int[] sortedValues)
protected abstract RealVar createRealVal(java.lang.String name, double min, double max)
protected abstract SetVar createSetVar(java.lang.String name, int a, int b)
protected abstract RealIntervalConstant createRealIntervalConstant(double a, double b)
protected abstract RealExp createRealSin(RealExp exp)
protected abstract RealExp createRealCos(RealExp exp)
protected abstract RealExp createRealIntegerPower(RealExp exp, int power)
protected abstract RealExp createRealPlus(RealExp exp1, RealExp exp2)
protected abstract RealExp createRealMinus(RealExp exp1, RealExp exp2)
protected abstract RealExp createRealMult(RealExp exp1, RealExp exp2)
protected abstract Constraint createEquation(RealVar[] tmpVars, RealExp exp, RealIntervalConstant cst)
protected abstract Constraint createMemberXY(SetVar sv1, IntVar var)
protected abstract Constraint createNotMemberXY(SetVar sv1, IntVar var)
protected abstract Constraint createMemberX(SetVar sv1, int val)
protected abstract Constraint createNotMemberX(SetVar sv1, int val)
protected abstract Constraint createDisjoint(SetVar sv1, SetVar sv2)
protected abstract Constraint createSetIntersection(SetVar sv1, SetVar sv2, SetVar inter)
protected abstract Constraint createSetCard(SetVar sv, IntVar v, boolean b1, boolean b2)
public final IntVar getIntVar(int i)
i
- index of the variable in the problempublic int getIntVarIndex(IntVar c)
public final int getNbIntVars()
public final RealVar getRealVar(int i)
i
- index of the variable
public final int getNbRealVars()
public final SetVar getSetVar(int i)
i
- index of the variable
public final int getNbSetVars()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |