choco.palm
Class JumpProblem

java.lang.Object
  extended by choco.AbstractModel
      extended by choco.AbstractProblem
          extended by choco.palm.JumpProblem
All Implemented Interfaces:
BoolModeler, IntModeler, ExplainedProblem
Direct Known Subclasses:
BendersProblem, PalmProblem

public class JumpProblem
extends AbstractProblem
implements ExplainedProblem


Field Summary
protected  Explanation contradictionExplanation
          Contradiction explanation: a conflict set justifying that the problem is inconsistent.
static boolean displayRelease
          States if the release information should be displayed during the next problem instantiation.
protected  java.util.BitSet erasedCst
          Set with last erased constraints (index that can be used for posted constraints)
 IStateInt indexOfLastInitializedStaticConstraint
          an index useful for re-propagating cuts (static constraints) upon backtracking
protected static java.util.logging.Logger logger
           
 int maxRelaxLevel
          Maximum relaxation level acceptable without user interaction.
 
Fields inherited from class choco.AbstractProblem
environment, feasible, precision, propagationEngine, reduction, solved, solver
 
Fields inherited from class choco.AbstractModel
constraints, doMaximize, FALSE, floatVars, intVars, nbConstraint, objective, setVars, TRUE
 
Constructor Summary
JumpProblem()
          Creates a Palm Problem with the specified environment.
 
Method Summary
 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 createAC2001BinConstraint(IntVar v1, IntVar v2, BinRelation relation)
           
 Constraint createAC3BinConstraint(IntVar v1, IntVar v2, BinRelation relation)
           
 Constraint createAC4BinConstraint(IntVar v1, IntVar v2, BinRelation relation)
           
 Constraint createAllDifferent(IntVar[] vars)
           
protected  Constraint createBinConjunction(Constraint c0, Constraint c1)
           
protected  Constraint createBinDisjunction(Constraint c0, Constraint c1)
           
protected  Constraint createBoolChanneling(IntVar b, IntVar x, int j)
           
protected  Constraint createBoundAllDiff(IntVar[] vars, boolean global)
           
protected  Constraint createCardinality(Constraint[] constList, IntVar cardVar, boolean b, boolean b1)
           
protected  Constraint createCspLargeConstraint(IntVar[] vs, LargeRelation relation)
           
protected  Constraint createCumulative(IntVar[] sts, IntVar[] ends, IntVar[] durations, int[] h, int Capa)
           
protected  Constraint createDisjoint(SetVar sv1, SetVar sv2)
           
protected  Constraint createEqualXC(IntVar v0, int c)
           
protected  Constraint createEqualXYC(IntVar v0, IntVar v1, int c)
           
protected  Constraint createEquation(RealVar[] tmpVars, RealExp exp, RealIntervalConstant cst)
           
protected  Constraint createEquiv(Constraint c0, Constraint c1)
           
 Constraint createGlobalCardinality(IntVar[] vars, int min, int max, int[] low, int[] up)
           
protected  Constraint createGreaterOrEqualXC(IntVar v0, int c)
           
protected  Constraint createGreaterOrEqualXYC(IntVar v0, IntVar v1, int c)
           
protected  Constraint createGuard(Constraint c0, Constraint c1)
           
protected  Constraint createIntLinComb(IntVar[] sortedVars, int[] sortedCoeffs, int nbPositiveCoeffs, int c, int linOperator)
           
protected  IntDomainVar createIntVar(java.lang.String name, int[] sortedValues)
           
protected  IntDomainVar createIntVar(java.lang.String name, int domainType, int min, int max)
           
protected  Constraint createInverseChanneling(IntVar[] x, IntVar[] y)
           
protected  Constraint createLargeConjunction(Constraint[] alternatives)
           
protected  Constraint createLargeDisjunction(Constraint[] alternatives)
           
protected  Constraint createLessOrEqualXC(IntVar v0, int c)
           
protected  Constraint createLex(IntVar[] v1, IntVar[] v2, boolean strict)
           
protected  Constraint createMemberX(SetVar sv1, int val)
           
protected  Constraint createMemberXY(SetVar sv1, IntVar var)
           
protected  Constraint createNotEqualXC(IntVar v0, int c)
           
protected  Constraint createNotEqualXYC(IntVar v0, IntVar v1, int c)
           
protected  Constraint createNotMemberX(SetVar sv1, int val)
           
protected  Constraint createNotMemberXY(SetVar sv1, IntVar var)
           
protected  Constraint createOccurrence(IntVar[] vars, int occval, boolean onInf, boolean onSup)
           
protected  RealExp createRealCos(RealExp exp)
           
protected  RealExp createRealIntegerPower(RealExp exp, int power)
           
protected  RealIntervalConstant createRealIntervalConstant(double a, double b)
           
protected  RealExp createRealMinus(RealExp exp1, RealExp exp2)
           
protected  RealExp createRealMult(RealExp exp1, RealExp exp2)
           
protected  RealExp createRealPlus(RealExp exp1, RealExp exp2)
           
protected  RealExp createRealSin(RealExp exp)
           
protected  RealVar createRealVal(java.lang.String name, double min, double max)
           
protected  Constraint createSetCard(SetVar sv, IntVar v, boolean b1, boolean b2)
           
protected  Constraint createSetIntersection(SetVar sv1, SetVar sv2, SetVar inter)
           
protected  SetVar createSetVar(java.lang.String name, int a, int b)
           
protected  Constraint createSubscript(IntVar index, int[] values, IntVar val, int offset)
           
protected  Constraint createSubscript(IntVar index, IntVar[] varArray, IntVar val, int offset)
           
protected  Constraint createTimesXYZ(IntVar x, IntVar y, IntVar z)
           
 void explainedFail(Explanation exp)
          throws a contradiction with the corresponding explanation
 AbstractConstraint getConstraintNb(int nb)
           
 Explanation getContradictionExplanation()
           
 IntDomainVar[] getVars()
          Deprecated.  
 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
 ExplainedConstraintPlugin makeConstraintPlugin(AbstractConstraint ct)
          Factory to create a constraint plugin
 Explanation makeExplanation()
          Factory to create explanation.
 Explanation makeExplanation(int level)
          Factory to create explanation.
 void post(Constraint cc)
          Posts a constraints in the problem.
 void postCut(Constraint cc)
          Posts a cut constraint in the problem.
static void ReleaseJumpDisplay()
          Displays release information (date, verions, ...).
 void setContradictionExplanation(Explanation contradictionExplanation)
          set an explanation to know why the problem is over-constrained.
 java.lang.Boolean solve(boolean all)
           
 void worldPop()
          popping one world from the stack: overrides AbstractProblem.worldPop because the Problem class adds the notion of static constraints that need be repropagated upon backtracking
 
Methods inherited from class choco.AbstractProblem
constraintsToString, eraseConstraint, getEnvironment, getIntConstraint, getIntConstraintIterator, getIntVarIndex, getNbIntConstraints, getPrecision, getProblem, getPropagationEngine, getReduction, getSolver, getWorldIndex, isConsistent, isFeasible, maximize, minimize, nextSolution, optimize, pretty, printRuntimeSatistics, propagate, setPrecision, setReduction, solutionToString, solve, solveAll, varsToString, worldPopUntil, worldPush
 
Methods inherited from class choco.AbstractModel
allDifferent, allDifferent, and, and, and, and, around, atleast, atmost, card, cos, countNonNullCoeffs, cst, cst, cumulative, eq, eq, eq, eq, eq, eq, eqCard, eqCard, feasPairAC, feasPairAC, feasPairAC, feasPairAC, feasTuple, geq, geq, geq, geq, geq, geq, geqCard, geqCard, getIntVar, getIntVarIndex, getNbIntVars, getNbRealVars, getNbSetVars, getRealVar, getSetVar, globalCardinality, globalCardinality, gt, gt, gt, ifOnlyIf, ifThen, implies, infeasPairAC, infeasPairAC, infeasPairAC, infeasPairAC, infeasTuple, leq, leq, leq, leq, leq, leq, leqCard, leqCard, lex, lexeq, lt, lt, lt, makeBoundIntVar, makeBoundIntVar, makeBoundIntVarArray, makeBoundIntVarArray, makeConjunction, makeConstantIntVar, makeConstantIntVar, makeDisjunction, makeEnumIntVar, makeEnumIntVar, makeEnumIntVarArray, makeEnumIntVarArray, makeEquation, makeIntLinComb, makeOccurrence, makePairAC, makePairAC, makeRealVar, makeRealVar, makeRealVar, makeSetVar, makeTupleFC, member, member, member, member, minus, minus, minus, minus, mult, mult, neq, neq, neq, not, notMember, notMember, notMember, notMember, nth, nth, occurenceMax, occurenceMin, occurrence, or, or, or, or, plus, plus, plus, plus, plus, power, relationPairAC, relationPairAC, relationTuple, scalar, scalar, setDisjoint, setInter, setMaximizationObjective, setMinimizationObjective, sin, sum, times
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final java.util.logging.Logger logger

displayRelease

public static boolean displayRelease
States if the release information should be displayed during the next problem instantiation.


maxRelaxLevel

public int maxRelaxLevel
Maximum relaxation level acceptable without user interaction.


erasedCst

protected java.util.BitSet erasedCst
Set with last erased constraints (index that can be used for posted constraints)


contradictionExplanation

protected Explanation contradictionExplanation
Contradiction explanation: a conflict set justifying that the problem is inconsistent.


indexOfLastInitializedStaticConstraint

public IStateInt indexOfLastInitializedStaticConstraint
an index useful for re-propagating cuts (static constraints) upon backtracking

Constructor Detail

JumpProblem

public JumpProblem()
Creates a Palm Problem with the specified environment.

Method Detail

ReleaseJumpDisplay

public static final void ReleaseJumpDisplay()
Displays release information (date, verions, ...).


makeExplanation

public Explanation makeExplanation()
Factory to create explanation. It offers the possibility to make another kind of explanation, only by extending PalmProblem

Specified by:
makeExplanation in interface ExplainedProblem
Returns:
the new explanation object

makeExplanation

public Explanation makeExplanation(int level)
Factory to create explanation. It offers the possibility to make another kind of explanation, only by extending PalmProblem

Returns:
the new explanation object

getVars

public IntDomainVar[] getVars()
Deprecated. 

Returns all variables of the variables.


explainedFail

public void explainedFail(Explanation exp)
                   throws ContradictionException
Description copied from interface: ExplainedProblem
throws a contradiction with the corresponding explanation

Specified by:
explainedFail in interface ExplainedProblem
Throws:
ContradictionException

post

public void post(Constraint cc)
Posts a constraints in the problem. This is a local constraint post that will be undone upon backtracking If it has ever been posted (but deactivated), it is only reactivated and repropagated.

Specified by:
post in class AbstractProblem
Parameters:
cc - The constraint to post.

postCut

public void postCut(Constraint cc)
Posts a cut constraint in the problem. (the constraint will not be undone upon backtracking)

Specified by:
postCut in class AbstractProblem
Parameters:
cc - The constraint to post.

worldPop

public final void worldPop()
popping one world from the stack: overrides AbstractProblem.worldPop because the Problem class adds the notion of static constraints that need be repropagated upon backtracking

Overrides:
worldPop in class AbstractProblem

makeConstraintPlugin

public ExplainedConstraintPlugin makeConstraintPlugin(AbstractConstraint ct)
Description copied from interface: ExplainedProblem
Factory to create a constraint plugin

Specified by:
makeConstraintPlugin in interface ExplainedProblem
Returns:

getConstraintNb

public AbstractConstraint getConstraintNb(int nb)
Specified by:
getConstraintNb in interface ExplainedProblem
Parameters:
nb - Constraint number (number affected when posting and stored in the variable plugin)
Returns:
Returns the constraint

getContradictionExplanation

public Explanation getContradictionExplanation()

setContradictionExplanation

public void setContradictionExplanation(Explanation contradictionExplanation)
Description copied from interface: ExplainedProblem
set an explanation to know why the problem is over-constrained.

Specified by:
setContradictionExplanation in interface ExplainedProblem

solve

public java.lang.Boolean solve(boolean all)
Specified by:
solve in class AbstractProblem

createEqualXC

protected Constraint createEqualXC(IntVar v0,
                                   int c)
Specified by:
createEqualXC in class AbstractModel

createNotEqualXC

protected Constraint createNotEqualXC(IntVar v0,
                                      int c)
Specified by:
createNotEqualXC in class AbstractModel

createGreaterOrEqualXC

protected Constraint createGreaterOrEqualXC(IntVar v0,
                                            int c)
Specified by:
createGreaterOrEqualXC in class AbstractModel

createLessOrEqualXC

protected Constraint createLessOrEqualXC(IntVar v0,
                                         int c)
Specified by:
createLessOrEqualXC in class AbstractModel

createEqualXYC

protected Constraint createEqualXYC(IntVar v0,
                                    IntVar v1,
                                    int c)
Specified by:
createEqualXYC in class AbstractModel

createGreaterOrEqualXYC

protected Constraint createGreaterOrEqualXYC(IntVar v0,
                                             IntVar v1,
                                             int c)
Specified by:
createGreaterOrEqualXYC in class AbstractModel

createNotEqualXYC

protected Constraint createNotEqualXYC(IntVar v0,
                                       IntVar v1,
                                       int c)
Specified by:
createNotEqualXYC in class AbstractModel

createTimesXYZ

protected Constraint createTimesXYZ(IntVar x,
                                    IntVar y,
                                    IntVar z)
Specified by:
createTimesXYZ in class AbstractModel

createIntLinComb

protected Constraint createIntLinComb(IntVar[] sortedVars,
                                      int[] sortedCoeffs,
                                      int nbPositiveCoeffs,
                                      int c,
                                      int linOperator)
Specified by:
createIntLinComb in class AbstractModel

createSubscript

protected Constraint createSubscript(IntVar index,
                                     int[] values,
                                     IntVar val,
                                     int offset)
Specified by:
createSubscript in class AbstractModel

createSubscript

protected Constraint createSubscript(IntVar index,
                                     IntVar[] varArray,
                                     IntVar val,
                                     int offset)
Specified by:
createSubscript in class AbstractModel

createInverseChanneling

protected Constraint createInverseChanneling(IntVar[] x,
                                             IntVar[] y)
Specified by:
createInverseChanneling in class AbstractModel

createBoolChanneling

protected Constraint createBoolChanneling(IntVar b,
                                          IntVar x,
                                          int j)
Specified by:
createBoolChanneling in class AbstractModel

createBinDisjunction

protected Constraint createBinDisjunction(Constraint c0,
                                          Constraint c1)
Specified by:
createBinDisjunction in class AbstractModel

createLargeDisjunction

protected Constraint createLargeDisjunction(Constraint[] alternatives)
Specified by:
createLargeDisjunction in class AbstractModel

createBinConjunction

protected Constraint createBinConjunction(Constraint c0,
                                          Constraint c1)
Specified by:
createBinConjunction in class AbstractModel

createLargeConjunction

protected Constraint createLargeConjunction(Constraint[] alternatives)
Specified by:
createLargeConjunction in class AbstractModel

createCardinality

protected Constraint createCardinality(Constraint[] constList,
                                       IntVar cardVar,
                                       boolean b,
                                       boolean b1)
Specified by:
createCardinality in class AbstractModel

createGuard

protected Constraint createGuard(Constraint c0,
                                 Constraint c1)
Specified by:
createGuard in class AbstractModel

createEquiv

protected Constraint createEquiv(Constraint c0,
                                 Constraint c1)
Specified by:
createEquiv in class AbstractModel

createAC3BinConstraint

public Constraint createAC3BinConstraint(IntVar v1,
                                         IntVar v2,
                                         BinRelation relation)
Specified by:
createAC3BinConstraint in class AbstractModel

createAC4BinConstraint

public Constraint createAC4BinConstraint(IntVar v1,
                                         IntVar v2,
                                         BinRelation relation)
Specified by:
createAC4BinConstraint in class AbstractModel

createAC2001BinConstraint

public Constraint createAC2001BinConstraint(IntVar v1,
                                            IntVar v2,
                                            BinRelation relation)
Specified by:
createAC2001BinConstraint in class AbstractModel

createCspLargeConstraint

protected Constraint createCspLargeConstraint(IntVar[] vs,
                                              LargeRelation relation)
Specified by:
createCspLargeConstraint in class AbstractModel

createOccurrence

protected Constraint createOccurrence(IntVar[] vars,
                                      int occval,
                                      boolean onInf,
                                      boolean onSup)
Specified by:
createOccurrence in class AbstractModel

createAllDifferent

public Constraint createAllDifferent(IntVar[] vars)
Specified by:
createAllDifferent in class AbstractModel

createBoundAllDiff

protected Constraint createBoundAllDiff(IntVar[] vars,
                                        boolean global)
Specified by:
createBoundAllDiff in class AbstractModel

createGlobalCardinality

public Constraint createGlobalCardinality(IntVar[] vars,
                                          int min,
                                          int max,
                                          int[] low,
                                          int[] up)
Specified by:
createGlobalCardinality in class AbstractModel

createCumulative

protected Constraint createCumulative(IntVar[] sts,
                                      IntVar[] ends,
                                      IntVar[] durations,
                                      int[] h,
                                      int Capa)
Specified by:
createCumulative in class AbstractModel

createIntVar

protected IntDomainVar createIntVar(java.lang.String name,
                                    int domainType,
                                    int min,
                                    int max)
Specified by:
createIntVar in class AbstractModel

createIntVar

protected IntDomainVar createIntVar(java.lang.String name,
                                    int[] sortedValues)
Specified by:
createIntVar in class AbstractModel

createRealVal

protected RealVar createRealVal(java.lang.String name,
                                double min,
                                double max)
Specified by:
createRealVal in class AbstractModel

createSetVar

protected SetVar createSetVar(java.lang.String name,
                              int a,
                              int b)
Specified by:
createSetVar in class AbstractModel

createRealIntervalConstant

protected RealIntervalConstant createRealIntervalConstant(double a,
                                                          double b)
Specified by:
createRealIntervalConstant in class AbstractModel

createRealSin

protected RealExp createRealSin(RealExp exp)
Specified by:
createRealSin in class AbstractModel

createRealCos

protected RealExp createRealCos(RealExp exp)
Specified by:
createRealCos in class AbstractModel

createRealIntegerPower

protected RealExp createRealIntegerPower(RealExp exp,
                                         int power)
Specified by:
createRealIntegerPower in class AbstractModel

createRealPlus

protected RealExp createRealPlus(RealExp exp1,
                                 RealExp exp2)
Specified by:
createRealPlus in class AbstractModel

createRealMinus

protected RealExp createRealMinus(RealExp exp1,
                                  RealExp exp2)
Specified by:
createRealMinus in class AbstractModel

createRealMult

protected RealExp createRealMult(RealExp exp1,
                                 RealExp exp2)
Specified by:
createRealMult in class AbstractModel

createEquation

protected Constraint createEquation(RealVar[] tmpVars,
                                    RealExp exp,
                                    RealIntervalConstant cst)
Specified by:
createEquation in class AbstractModel

createMemberXY

protected Constraint createMemberXY(SetVar sv1,
                                    IntVar var)
Specified by:
createMemberXY in class AbstractModel

createNotMemberXY

protected Constraint createNotMemberXY(SetVar sv1,
                                       IntVar var)
Specified by:
createNotMemberXY in class AbstractModel

createMemberX

protected Constraint createMemberX(SetVar sv1,
                                   int val)
Specified by:
createMemberX in class AbstractModel

createNotMemberX

protected Constraint createNotMemberX(SetVar sv1,
                                      int val)
Specified by:
createNotMemberX in class AbstractModel

createDisjoint

protected Constraint createDisjoint(SetVar sv1,
                                    SetVar sv2)
Specified by:
createDisjoint in class AbstractModel

createSetIntersection

protected Constraint createSetIntersection(SetVar sv1,
                                           SetVar sv2,
                                           SetVar inter)
Specified by:
createSetIntersection in class AbstractModel

createSetCard

protected Constraint createSetCard(SetVar sv,
                                   IntVar v,
                                   boolean b1,
                                   boolean b2)
Specified by:
createSetCard in class AbstractModel

boolChanneling

public Constraint boolChanneling(IntVar b,
                                 IntVar x,
                                 int j)
Description copied from class: AbstractModel
State a simple channeling bewteen a boolean variable and an interger variable Ensures for that b = 1 iff x = j

Overrides:
boolChanneling in class AbstractModel
Parameters:
b - : a boolean variable
x - : an integer variable
j - : the value such that b = 1 ssi x = j, and b = 0 otherwise

inverseChanneling

public Constraint inverseChanneling(IntVar[] x,
                                    IntVar[] y)
Description copied from class: AbstractModel
State a channeling bewteen two arrays of integer variables x and y with the same domain which enforces x[i] = j <=> y[j] = i

Overrides:
inverseChanneling in class AbstractModel

createLex

protected Constraint createLex(IntVar[] v1,
                               IntVar[] v2,
                               boolean strict)
Specified by:
createLex in class AbstractModel