choco.palm
Class PalmProblem

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

public class PalmProblem
extends JumpProblem
implements ExplainedProblem

Choco problem extension involving explanations and explanation-based algorithms (mac-dbt, decision-repair...)


Field Summary
 
Fields inherited from class choco.palm.JumpProblem
contradictionExplanation, displayRelease, erasedCst, indexOfLastInitializedStaticConstraint, logger, maxRelaxLevel
 
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
PalmProblem()
          Creates a Palm Problem with the specified environment.
 
Method Summary
 boolean checkSolution()
          Checks if current solution is still valid.
protected  IntDomainVar createIntVar(java.lang.String name, int[] sortedValues)
           
protected  IntDomainVar createIntVar(java.lang.String name, int domainType, int min, int max)
           
protected  RealVar createRealVal(java.lang.String name, double min, double max)
           
 void explainedFail(Explanation exp)
          throws a contradiction with the corresponding explanation
 int getMaxRelaxLevel()
          Returns the maximum level the solver can relax without user interaction.
 ExplainedConstraintPlugin makeConstraintPlugin(AbstractConstraint ct)
          Factory to create a constraint plugin
 Explanation makeExplanation()
          Factory to create explanation.
 java.lang.Boolean maximize(Var objective, boolean restart)
          Maximize an objective variable with a PalmBranchAndBound
 java.lang.Boolean minimize(Var objective, boolean restart)
          Minimize an objective variable with a PalmBranchAndBound
 java.lang.Boolean nextSolution()
          Tries to find another solution.
 void post(Constraint constraint)
          Posts a constraints in the problem.
 void post(Constraint constraint, int w)
          Posts a constraint with the specified weight.
 void post(Constraint constraint, PalmExplanation expl)
          Posts an indirect constraint with an explain.
 void postCut(Constraint constraint)
          Posts a cut constraint in the problem.
 void propagateAllDecisionsConstraints(java.util.List constraints)
          Posts and propagates several decision constraints (that is decisions taken by the solver).
static void ReleasePalmDisplay()
          Displays release information (date, verions, ...).
 void remove(Propagator constraint)
          Removes properly a constraint from the problem: the constraint is deactivated and all the depending filtering decisions are undone.
 void repair()
          Tries to repair the problem after a PalmContradiction thanks to removing a responsible constraint (that is a constraint in the explain of the contradiction).
 java.lang.Boolean searchOneSolution()
          Deprecated.  
 void setMaxRelaxLevel(int maxRelaxLevel)
          Sets the maximum level the solver can relax without user interaction (default value is 0, that is only decision constraints).
 java.lang.Boolean solve()
          Tries to search the first solution of the problem.
 java.lang.Boolean solve(boolean allSolutions)
          Deprecated.  
 java.lang.Boolean solveAll()
          Tries to find all solutions of the problem.
 
Methods inherited from class choco.palm.JumpProblem
boolChanneling, createAC2001BinConstraint, createAC3BinConstraint, createAC4BinConstraint, createAllDifferent, createBinConjunction, createBinDisjunction, createBoolChanneling, createBoundAllDiff, createCardinality, createCspLargeConstraint, createCumulative, createDisjoint, createEqualXC, createEqualXYC, createEquation, createEquiv, createGlobalCardinality, createGreaterOrEqualXC, createGreaterOrEqualXYC, createGuard, createIntLinComb, createInverseChanneling, createLargeConjunction, createLargeDisjunction, createLessOrEqualXC, createLex, createMemberX, createMemberXY, createNotEqualXC, createNotEqualXYC, createNotMemberX, createNotMemberXY, createOccurrence, createRealCos, createRealIntegerPower, createRealIntervalConstant, createRealMinus, createRealMult, createRealPlus, createRealSin, createSetCard, createSetIntersection, createSetVar, createSubscript, createSubscript, createTimesXYZ, getConstraintNb, getContradictionExplanation, getVars, inverseChanneling, makeExplanation, ReleaseJumpDisplay, setContradictionExplanation, worldPop
 
Methods inherited from class choco.AbstractProblem
constraintsToString, eraseConstraint, getEnvironment, getIntConstraint, getIntConstraintIterator, getIntVarIndex, getNbIntConstraints, getPrecision, getProblem, getPropagationEngine, getReduction, getSolver, getWorldIndex, isConsistent, isFeasible, optimize, pretty, printRuntimeSatistics, propagate, setPrecision, setReduction, solutionToString, 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
 
Methods inherited from interface choco.palm.ExplainedProblem
getConstraintNb, setContradictionExplanation
 

Constructor Detail

PalmProblem

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

Method Detail

ReleasePalmDisplay

public static final void ReleasePalmDisplay()
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
Overrides:
makeExplanation in class JumpProblem
Returns:
the new explanation object

makeConstraintPlugin

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

Specified by:
makeConstraintPlugin in interface ExplainedProblem
Overrides:
makeConstraintPlugin in class JumpProblem
Returns:

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
Overrides:
explainedFail in class JumpProblem
Throws:
ContradictionException

searchOneSolution

public java.lang.Boolean searchOneSolution()
Deprecated. 

Searches one solution of the problem.

Returns:
True if a solution was found.

solve

public java.lang.Boolean solve(boolean allSolutions)
Deprecated. 

Tries to search the problem by finding one solution or all solutions.

Overrides:
solve in class JumpProblem
Parameters:
allSolutions - If true, all the solutions are searched.

solve

public java.lang.Boolean solve()
Tries to search the first solution of the problem.

Overrides:
solve in class AbstractProblem

nextSolution

public java.lang.Boolean nextSolution()
Tries to find another solution.

Overrides:
nextSolution in class AbstractProblem

checkSolution

public boolean checkSolution()
Checks if current solution is still valid.


solveAll

public java.lang.Boolean solveAll()
Tries to find all solutions of the problem.

Overrides:
solveAll in class AbstractProblem

maximize

public java.lang.Boolean maximize(Var objective,
                                  boolean restart)
Maximize an objective variable with a PalmBranchAndBound

Overrides:
maximize in class AbstractProblem
Parameters:
objective - The variable modelling the optimization criterion
restart - If true, then a new search is restarted from scratch after each solution is found; otherwise a single branch-and-bound search is performed

minimize

public java.lang.Boolean minimize(Var objective,
                                  boolean restart)
Minimize an objective variable with a PalmBranchAndBound

Overrides:
minimize in class AbstractProblem
Parameters:
objective - The variable modelling the optimization criterion
restart - If true, then a new search is restarted from scratch after each solution is found; otherwise a single branch-and-bound search is performed

post

public void post(Constraint constraint)
Posts a constraints in the problem. If it has ever been posted (but deactivated), it is only reactivated and repropagated.

Overrides:
post in class JumpProblem
Parameters:
constraint - The constraint to post.

postCut

public void postCut(Constraint constraint)
Description copied from class: JumpProblem
Posts a cut constraint in the problem. (the constraint will not be undone upon backtracking)

Overrides:
postCut in class JumpProblem
Parameters:
constraint - The constraint to post.

post

public void post(Constraint constraint,
                 int w)
Posts a constraint with the specified weight.

Parameters:
constraint - The constraint to post.
w - The weight associated to the constraint.

post

public void post(Constraint constraint,
                 PalmExplanation expl)
Posts an indirect constraint with an explain.

Parameters:
constraint - The constraint to post.
expl - The set of constraint this posted constraint depends on.

propagateAllDecisionsConstraints

public void propagateAllDecisionsConstraints(java.util.List constraints)
                                      throws ContradictionException
Posts and propagates several decision constraints (that is decisions taken by the solver).

Parameters:
constraints - The constraints to post.
Throws:
ContradictionException

repair

public void repair()
            throws ContradictionException
Tries to repair the problem after a PalmContradiction thanks to removing a responsible constraint (that is a constraint in the explain of the contradiction).

Throws:
ContradictionException

remove

public void remove(Propagator constraint)
Removes properly a constraint from the problem: the constraint is deactivated and all the depending filtering decisions are undone.

Parameters:
constraint - The constraint to remove.

getMaxRelaxLevel

public int getMaxRelaxLevel()
Returns the maximum level the solver can relax without user interaction.


setMaxRelaxLevel

public void setMaxRelaxLevel(int maxRelaxLevel)
Sets the maximum level the solver can relax without user interaction (default value is 0, that is only decision constraints).

Parameters:
maxRelaxLevel - the new level

createRealVal

protected RealVar createRealVal(java.lang.String name,
                                double min,
                                double max)
Overrides:
createRealVal in class JumpProblem

createIntVar

protected IntDomainVar createIntVar(java.lang.String name,
                                    int domainType,
                                    int min,
                                    int max)
Overrides:
createIntVar in class JumpProblem

createIntVar

protected IntDomainVar createIntVar(java.lang.String name,
                                    int[] sortedValues)
Overrides:
createIntVar in class JumpProblem