|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractModel
choco.AbstractProblem
public abstract class AbstractProblem
Field Summary | |
---|---|
protected Environment |
environment
The environment managing the backtrackable data. |
java.lang.Boolean |
feasible
Allows to know if the problem is feasible (null if it was not solved). |
protected double |
precision
Precision of the search for a real problem. |
protected AbstractPropagationEngine |
propagationEngine
The propagation engine to propagate during solving. |
protected double |
reduction
Minimal width reduction between two propagations. |
protected boolean |
solved
True if the problem was solved. |
protected Solver |
solver
The object controlling the global search exploration |
Fields inherited from class choco.AbstractModel |
---|
constraints, doMaximize, FALSE, floatVars, intVars, nbConstraint, objective, setVars, TRUE |
Constructor Summary | |
---|---|
AbstractProblem()
|
|
AbstractProblem(Environment env)
|
Method Summary | |
---|---|
java.lang.String |
constraintsToString()
|
void |
eraseConstraint(Constraint c)
removes (permanently) a constraint from the overall list of constraints of the problem |
Environment |
getEnvironment()
Returns the memory environment used by the problem. |
IntConstraint |
getIntConstraint(int i)
Deprecated. |
java.util.Iterator |
getIntConstraintIterator()
|
int |
getIntVarIndex(IntDomainVar c)
|
int |
getNbIntConstraints()
retrieving the total number of constraints over integers |
double |
getPrecision()
|
AbstractProblem |
getProblem()
As all Entity, must be able to return a Problem, returns itself. |
PropagationEngine |
getPropagationEngine()
Returns the propagation engine associated to the problem |
double |
getReduction()
|
Solver |
getSolver()
accessor returning the handler of the object responsible for the resolution of the problem. |
int |
getWorldIndex()
returning the index of the current worl |
boolean |
isConsistent()
|
java.lang.Boolean |
isFeasible()
test if the problem has been found to be feasible (there exist solutions) or not. |
java.lang.Boolean |
maximize(Var obj,
boolean restart)
resolution: Searches for the solution maximizing the objective criterion. |
java.lang.Boolean |
minimize(Var obj,
boolean restart)
Resolution: Searches for the solution minimizing the objective criterion. |
java.lang.Boolean |
nextSolution()
|
protected java.lang.Boolean |
optimize(boolean maximize,
Var obj,
boolean restart)
|
abstract void |
post(Constraint c)
|
abstract void |
postCut(Constraint c)
|
java.lang.String |
pretty()
|
void |
printRuntimeSatistics()
Displays all the runtime statistics. |
void |
propagate()
Propagation: Computes consistency on the problem (the problem may no longer be consistent since the last propagation because of listeners that have been posted and variables that have been reduced |
void |
setPrecision(double precision)
|
void |
setReduction(double reduction)
|
java.lang.String |
solutionToString()
|
java.lang.Boolean |
solve()
|
abstract java.lang.Boolean |
solve(boolean all)
|
java.lang.Boolean |
solveAll()
|
java.lang.String |
varsToString()
|
void |
worldPop()
pushing one world on the stack |
void |
worldPopUntil(int n)
Backtracks to a given level in the search tree. |
void |
worldPush()
pushing one world on the stack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double precision
protected double reduction
public java.lang.Boolean feasible
protected boolean solved
protected Environment environment
protected AbstractPropagationEngine propagationEngine
protected Solver solver
Constructor Detail |
---|
public AbstractProblem(Environment env)
public AbstractProblem()
Method Detail |
---|
public final Environment getEnvironment()
public int getIntVarIndex(IntDomainVar c)
public final int getNbIntConstraints()
public final IntConstraint getIntConstraint(int i)
i
- index of the variable in the problempublic java.util.Iterator getIntConstraintIterator()
public final AbstractProblem getProblem()
public final java.lang.Boolean isFeasible()
public final boolean isConsistent()
public java.lang.String pretty()
public java.lang.String varsToString()
public java.lang.String constraintsToString()
public java.lang.String solutionToString()
public void eraseConstraint(Constraint c)
public double getPrecision()
public void setPrecision(double precision)
public double getReduction()
public void setReduction(double reduction)
public PropagationEngine getPropagationEngine()
public final Solver getSolver()
public abstract void post(Constraint c)
public abstract void postCut(Constraint c)
public void propagate() throws ContradictionException
ContradictionException
public void worldPush()
public void worldPop()
public final void worldPopUntil(int n)
public final int getWorldIndex()
public java.lang.Boolean solve()
public java.lang.Boolean nextSolution()
public void printRuntimeSatistics()
public abstract java.lang.Boolean solve(boolean all)
public java.lang.Boolean solveAll()
public java.lang.Boolean minimize(Var obj, boolean restart)
obj
- The variable modelling the optimization criterionrestart
- If true, then a new search is restarted from scratch
after each solution is found;
otherwise a single branch-and-bound search is performedpublic java.lang.Boolean maximize(Var obj, boolean restart)
obj
- The variable modelling the optimization criterionrestart
- If true, then a new search is restarted from scratch
after each solution is found;
otherwise a single branch-and-bound search is performedprotected java.lang.Boolean optimize(boolean maximize, Var obj, boolean restart)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |