|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Solver
Created by IntelliJ IDEA. User: charles Date: 12 mars 2008 Time: 16:43:08 Interface for Solver class, declare main expected methods.
Field Summary | |
---|---|
static SolutionCheckerEngine |
DEFAULT_SOLUTION_CHECKER
|
static Logger |
LOGGER
Reference to an object for logging trace statements related to Abtract Solver (using the java.util.logging package) |
Method Summary | ||
---|---|---|
|
_to(MV[] mv,
SV[] sv)
|
|
|
_to(MV mv,
SV sv)
|
|
void |
addGoal(AbstractIntBranchingStrategy branching)
Adds a new branching goal to the end of list of goals |
|
void |
attachGoal(AbstractIntBranchingStrategy branching)
Deprecated. calls clearGoals() then
addGoal(choco.kernel.solver.branch.AbstractIntBranchingStrategy) |
|
boolean |
checkDecisionVariables()
Check wether every decisions variables are instantiated |
|
Boolean |
checkSolution()
Solution checker. |
|
void |
clear()
Removes all of the elements from this solver (optional operation). |
|
void |
clearGoals()
Clears the list of goals defined |
|
IntDomainVar |
createBinTreeIntVar(String name,
int[] sortedValues)
|
|
IntDomainVar |
createBinTreeIntVar(String name,
int min,
int max)
|
|
IntDomainVar |
createBooleanVar(String name)
|
|
IntDomainVar |
createBoundIntVar(String name,
int min,
int max)
|
|
SetVar |
createBoundSetVar(String name,
int a,
int b)
|
|
IntDomainVar |
createEnumIntVar(String name,
int[] sortedValues)
|
|
IntDomainVar |
createEnumIntVar(String name,
int min,
int max)
|
|
SetVar |
createEnumSetVar(String name,
int a,
int b)
|
|
IntDomainVar |
createIntegerConstant(String name,
int val)
|
|
IntDomainVar |
createIntVar(String name,
int domainType,
int min,
int max)
|
|
RealConstant |
createRealConstant(String name,
double val)
|
|
RealConstant |
createRealIntervalConstant(double a,
double b)
|
|
RealVar |
createRealVal(String name,
double min,
double max)
|
|
SetVar |
createSetVar(String name,
int a,
int b,
int domainType)
|
|
TaskVar |
createTaskVar(String name,
IntDomainVar start,
IntDomainVar end,
IntDomainVar duration)
|
|
RealConstant |
cst(double d)
Makes a constant interval from a double d ([d,d]). |
|
RealConstant |
cst(double a,
double b)
Makes a constant interval between two doubles [a,b]. |
|
SConstraint |
eq(IntExp x,
int c)
|
|
SConstraint |
eq(IntExp x,
IntExp y)
|
|
SConstraint |
eq(int c,
IntExp x)
|
|
SConstraint |
eq(RealVar r,
IntDomainVar i)
|
|
void |
eraseConstraint(SConstraint c)
|
|
void |
generateSearchStrategy()
|
|
SConstraint |
geq(IntExp x,
int c)
|
|
SConstraint |
geq(IntExp x,
IntExp y)
|
|
SConstraint |
geq(int c,
IntExp x)
|
|
Configuration |
getConfiguration()
Return the current configuration of the solver |
|
DisposableIterator<SConstraint> |
getConstraintIterator()
|
|
SConstraint |
getCstr(Constraint ic)
|
|
AbstractGlobalSearchLimit |
getEncounteredLimit()
If a limit has been encountered, return the involved limit |
|
IEnvironment |
getEnvironment()
Returns the memory environment used by the model. |
|
boolean |
getFirstSolution()
Deprecated. |
|
int |
getHorizon()
Deprecated. |
|
IndexFactory |
getIndexfactory()
|
|
Var |
getIntConstant(int i)
Returns the constant corresponding to the int i. |
|
Collection<Integer> |
getIntConstantSet()
Returns the collection of integer constant values |
|
AbstractIntSConstraint |
getIntConstraint(int i)
Deprecated. |
|
DisposableIterator<SConstraint> |
getIntConstraintIterator()
Deprecated. |
|
IntDomainVar[] |
getIntDecisionVars()
get the list of decision integer variables. |
|
IntDomainVar |
getIntVar(int i)
Network management: Retrieve a variable by its index (all integer variables of the model are numbered in sequence from 0 on) |
|
int |
getIntVarIndex(IntVar c)
|
|
DisposableIterator<IntDomainVar> |
getIntVarIterator()
|
|
IntDomainVar |
getIntVarQuick(int i)
|
|
int |
getLoggingMaxDepth()
Deprecated. |
|
IntDomainVar |
getMakespan()
Get the makespan variable if any |
|
int |
getMakespanValue()
get the makespan value or +inf. |
|
Model |
getModel()
|
|
int |
getNbBooleanVars()
Returns the number of variables modelling boolean. |
|
int |
getNbConstants()
retrieving the total number of constants |
|
int |
getNbConstraints()
retrieving the total number of constraints over integers |
|
int |
getNbIntConstraints()
retrieving the total number of constraints |
|
int |
getNbIntVars()
retrieving the total number of integer variables |
|
int |
getNbRealVars()
Returns the number of variables modelling real numbers. |
|
int |
getNbSetVars()
Returns the number of variables modelling real numbers. |
|
int |
getNbSolutions()
returns the number of solutions encountered during the search |
|
int |
getNbTaskVars()
Returns the number of variables modelling tasks. |
|
int |
getNbVars()
retrieving the total number of variables |
|
Var |
getObjective()
|
|
Number |
getOptimumValue()
|
|
double |
getPrecision()
Deprecated. |
|
PropagationEngine |
getPropagationEngine()
Returns the propagation engine associated to the model |
|
Var |
getRealConstant(double i)
Returns the constant corresponding to the real i. |
|
Collection<Double> |
getRealConstantSet()
Returns the collection of real constant values |
|
RealVar[] |
getRealDecisionVars()
get the list of decision real variables. |
|
RealVar |
getRealVar(int i)
Returns a real variable. |
|
DisposableIterator<RealVar> |
getRealVarIterator()
|
|
RealVar |
getRealVarQuick(int i)
|
|
double |
getReduction()
Deprecated. |
|
AbstractGlobalSearchStrategy |
getSearchStrategy()
|
|
SetVar[] |
getSetDecisionVars()
get the list of decision set variables. |
|
SetVar |
getSetVar(int i)
Returns a set variable. |
|
DisposableIterator<SetVar> |
getSetVarIterator()
|
|
SetVar |
getSetVarQuick(int i)
|
|
TaskVar[] |
getTaskDecisionVars()
get the list of decision task variables. |
|
TaskVar |
getTaskVar(int i)
Returns a task variable. |
|
DisposableIterator<TaskVar> |
getTaskVarIterator()
|
|
TaskVar |
getTaskVarQuick(int i)
|
|
|
getVar(Class<SV> clazz,
MV[] mv)
|
|
IntDomainVar[] |
getVar(IntegerVariable... v)
|
|
IntDomainVar |
getVar(IntegerVariable v)
|
|
|
getVar(MV v)
|
|
RealVar[] |
getVar(RealVariable... v)
|
|
RealVar |
getVar(RealVariable v)
|
|
SetVar[] |
getVar(SetVariable... v)
|
|
SetVar |
getVar(SetVariable v)
|
|
TaskVar[] |
getVar(TaskVariable... v)
|
|
TaskVar |
getVar(TaskVariable v)
|
|
int |
getWorldIndex()
returning the index of the current worl |
|
SConstraint |
gt(IntExp x,
int c)
|
|
SConstraint |
gt(IntExp x,
IntExp y)
|
|
SConstraint |
gt(int c,
IntExp x)
|
|
boolean |
isEncounteredLimit()
Checks if a limit has been encountered |
|
Boolean |
isFeasible()
|
|
boolean |
isOptimizationSolver()
|
|
void |
launch()
commands the strategy to start |
|
SConstraint |
leq(IntExp x,
int c)
|
|
SConstraint |
leq(IntExp x,
IntExp y)
|
|
SConstraint |
leq(int c,
IntExp x)
|
|
SConstraint |
lt(IntExp x,
int c)
|
|
SConstraint |
lt(IntExp x,
IntExp y)
|
|
SConstraint |
lt(int c,
IntExp x)
|
|
BinRelation |
makeBinRelation(int[] min,
int[] max,
List<int[]> mat,
boolean feas)
|
|
BinRelation |
makeBinRelation(int[] min,
int[] max,
List<int[]> mat,
boolean feas,
boolean bitset)
|
|
LargeRelation |
makeLargeRelation(int[] min,
int[] max,
List<int[]> tuples,
boolean feas)
|
|
LargeRelation |
makeLargeRelation(int[] min,
int[] max,
List<int[]> tuples,
boolean feas,
int scheme)
|
|
Boolean |
maximize(boolean restart)
|
|
Boolean |
maximize(Var obj,
boolean restart)
|
|
Boolean |
minimize(boolean restart)
|
|
Boolean |
minimize(Var obj,
boolean restart)
|
|
void |
monitorBackTrackLimit(boolean b)
Deprecated. |
|
void |
monitorFailLimit(boolean b)
Monitor the fail limit (default to false) |
|
void |
monitorNodeLimit(boolean b)
Deprecated. |
|
void |
monitorTimeLimit(boolean b)
Deprecated. |
|
SConstraint |
neq(IntExp x,
int c)
|
|
SConstraint |
neq(IntExp x,
IntExp y)
|
|
SConstraint |
neq(int c,
IntExp x)
|
|
Boolean |
nextSolution()
|
|
IntExp |
plus(IntExp v1,
int v2)
|
|
IntExp |
plus(IntExp v1,
IntExp v2)
|
|
IntExp |
plus(int v1,
IntExp v2)
|
|
void |
post(SConstraint c)
|
|
void |
postCut(SConstraint c)
|
|
void |
printRuntimeStatistics()
|
|
void |
propagate()
Propagation: Computes consistency on the model (the model may no longer be consistent since the last propagation because of listeners that have been posted and variables that have been reduced |
|
void |
read(Model m)
|
|
Solution |
recordSolution()
Record a solution by getting every variables' value. |
|
SConstraint |
relationTupleAC(IntDomainVar[] vs,
LargeRelation rela)
|
|
SConstraint |
relationTupleAC(IntDomainVar[] vs,
LargeRelation rela,
int ac)
|
|
void |
restoreSolution(Solution sol)
Restore a solution by setting value to every variable |
|
String |
runtimeStatistics()
|
|
IntExp |
scalar(int[] lc,
IntDomainVar[] lv)
|
|
IntExp |
scalar(IntDomainVar[] lv,
int[] lc)
|
|
void |
setBackTrackLimit(int backtracklimit)
Sets the backtrack limit i.e. the maximal number of backtracks before stopping the search algorithm |
|
void |
setCardReasoning(boolean creas)
Deprecated. |
|
void |
setDoMaximize(boolean doMaximize)
Deprecated. |
|
void |
setFailLimit(int failLimit)
Sets the fail limit i.e. the maximal numnber of fails before stopping the search algorithm |
|
void |
setFeasible(Boolean b)
|
|
void |
setFirstSolution(boolean firstSolution)
Deprecated. |
|
void |
setHorizon(int horizon)
Deprecated. |
|
void |
setIlogGoal(Goal ilogGoal)
|
|
void |
setLoggingMaxDepth(int loggingMaxDepth)
Deprecated. |
|
void |
setModel(Model model)
|
|
void |
setNodeLimit(int nodeLimit)
Sets the node limit i.e. the maximal number of nodes explored by the search algorithm |
|
void |
setObjective(Var objective)
Set the variable to optimize |
|
void |
setPrecision(double precision)
Deprecated. |
|
void |
setReduction(double reduction)
Deprecated. |
|
void |
setRestart(boolean restart)
Deprecated. |
|
void |
setRestartLimit(int restartLimit)
Sets the restart limit i.e. the maximal number of restart performed during the search algorithm. |
|
void |
setSolutionDisplay(ISolutionDisplay solutionDisplay)
Set Custom pretty print of solutions |
|
void |
setSolutionPoolCapacity(int capacity)
Deprecated. |
|
void |
setTimeLimit(int timeLimit)
Sets the time limit i.e. the maximal time before stopping the search algorithm |
|
void |
setValIntIterator(ValIterator<IntDomainVar> valIterator)
Sets the integer value iterator the search should use |
|
void |
setValIntSelector(ValSelector<IntDomainVar> valSelector)
Sets the integer value selector the search should use |
|
void |
setValRealIterator(ValIterator<RealVar> realValIterator)
Sets the real value iterator the search should use |
|
void |
setValRealSelector(ValSelector<RealVar> valSelector)
Sets the integer value selector the search should use |
|
void |
setValSetIterator(ValIterator<SetVar> valIterator)
Sets the integer value iterator the search should use |
|
void |
setValSetSelector(ValSelector<SetVar> setValIntSelector)
Sets the integer value selector the search should use |
|
void |
setVarIntSelector(VarSelector<IntDomainVar> varSelector)
Sets the integer variable selector the search olver should use. |
|
void |
setVarRealSelector(VarSelector<RealVar> realVarSelector)
Sets the real variable selector the search strategy should use. |
|
void |
setVarSetSelector(VarSelector<SetVar> setVarIntSelector)
Sets the set variable selector the search strategy should use. |
|
Boolean |
solve()
|
|
Boolean |
solve(boolean all)
|
|
Boolean |
solveAll()
|
|
IntExp |
sum(IntExp... lv)
|
|
void |
worldPop()
popping one world from the stack: overrides AbstractModel.worldPop because the Model class adds the notion of static constraints that need be repropagated upon backtracking |
|
void |
worldPopDuringPropagation()
poping the world during propagation |
|
void |
worldPopUntil(int n)
Backtracks to a given level in the search tree. |
|
void |
worldPush()
pushing one world on the stack |
|
void |
worldPushDuringPropagation()
pushing the world during propagation |
Methods inherited from interface choco.kernel.solver.search.ISolutionDisplay |
---|
solutionToString |
Methods inherited from interface choco.kernel.solver.search.measure.IPreSolveMeasures |
---|
getInitialPropagationTimeCount, getReadingTimeCount |
Methods inherited from interface choco.kernel.solver.search.measure.IOptimizationMeasures |
---|
getObjectiveValue, isObjectiveOptimal |
Methods inherited from interface choco.kernel.solver.search.measure.ISolutionMeasures |
---|
existsSolution, getSolutionCount |
Methods inherited from interface choco.kernel.solver.search.measure.ISearchMeasures |
---|
getBackTrackCount, getFailCount, getNodeCount, getRestartCount, getSolutionCount, getTimeCount |
Methods inherited from interface choco.IPretty |
---|
pretty |
Field Detail |
---|
static final SolutionCheckerEngine DEFAULT_SOLUTION_CHECKER
static final Logger LOGGER
Method Detail |
---|
void clear()
IndexFactory getIndexfactory()
Model getModel()
void setModel(Model model)
void generateSearchStrategy()
@Deprecated void attachGoal(AbstractIntBranchingStrategy branching)
clearGoals()
then
addGoal(choco.kernel.solver.branch.AbstractIntBranchingStrategy)
void addGoal(AbstractIntBranchingStrategy branching)
branching
- new goal to addvoid clearGoals()
boolean checkDecisionVariables()
void launch()
int getNbSolutions()
@Deprecated void monitorTimeLimit(boolean b)
b
- indicates wether the search stategy monitor the time limit@Deprecated void monitorNodeLimit(boolean b)
b
- indicates wether the search stategy monitor the node limit@Deprecated void monitorBackTrackLimit(boolean b)
b
- indicates wether the search stategy monitor the backtrack limitvoid monitorFailLimit(boolean b)
b
- indicates wether the search stategy monitor the fail limitvoid setTimeLimit(int timeLimit)
void setNodeLimit(int nodeLimit)
void setBackTrackLimit(int backtracklimit)
void setFailLimit(int failLimit)
void setRestartLimit(int restartLimit)
boolean getFirstSolution()
void setFirstSolution(boolean firstSolution)
void setVarIntSelector(VarSelector<IntDomainVar> varSelector)
void setVarRealSelector(VarSelector<RealVar> realVarSelector)
void setVarSetSelector(VarSelector<SetVar> setVarIntSelector)
void setValIntIterator(ValIterator<IntDomainVar> valIterator)
void setValRealIterator(ValIterator<RealVar> realValIterator)
void setValSetIterator(ValIterator<SetVar> valIterator)
void setValIntSelector(ValSelector<IntDomainVar> valSelector)
void setValRealSelector(ValSelector<RealVar> valSelector)
void setValSetSelector(ValSelector<SetVar> setValIntSelector)
@Deprecated DisposableIterator<SConstraint> getIntConstraintIterator()
DisposableIterator<SConstraint> getConstraintIterator()
DisposableIterator<IntDomainVar> getIntVarIterator()
DisposableIterator<SetVar> getSetVarIterator()
DisposableIterator<RealVar> getRealVarIterator()
DisposableIterator<TaskVar> getTaskVarIterator()
PropagationEngine getPropagationEngine()
@Deprecated void setRestart(boolean restart)
restart
- @Deprecated void setDoMaximize(boolean doMaximize)
doMaximize
- void setObjective(Var objective)
objective
- variable to optimizeVar getObjective()
boolean isOptimizationSolver()
Number getOptimumValue()
void setHorizon(int horizon)
horizon
- scheduling horizonint getHorizon()
IntDomainVar getMakespan()
int getMakespanValue()
boolean isEncounteredLimit()
AbstractGlobalSearchLimit getEncounteredLimit()
AbstractGlobalSearchStrategy getSearchStrategy()
void post(SConstraint c)
void postCut(SConstraint c)
IntDomainVar getIntVar(int i)
i
- index of the variable in the model
IntDomainVar getIntVarQuick(int i)
int getIntVarIndex(IntVar c)
int getNbVars()
int getNbIntVars()
int getNbConstants()
Var getIntConstant(int i)
i
- object (value) of the constant represented as an instantiated "variable"
Var getRealConstant(double i)
i
- object (value) of the constant represented as an instantiated "variable"
Collection<Integer> getIntConstantSet()
Collection<Double> getRealConstantSet()
RealVar getRealVar(int i)
i
- index of the variable
RealVar getRealVarQuick(int i)
int getNbRealVars()
SetVar getSetVar(int i)
i
- index of the variable
SetVar getSetVarQuick(int i)
int getNbSetVars()
TaskVar getTaskVar(int i)
i
- index of the variable
TaskVar getTaskVarQuick(int i)
int getNbTaskVars()
int getNbBooleanVars()
IntDomainVar[] getIntDecisionVars()
SetVar[] getSetDecisionVars()
RealVar[] getRealDecisionVars()
TaskVar[] getTaskDecisionVars()
@Deprecated void setPrecision(double precision)
precision
- the new precision@Deprecated double getPrecision()
@Deprecated void setReduction(double reduction)
reduction
- new width reduction@Deprecated double getReduction()
void propagate() throws ContradictionException
ContradictionException
Boolean maximize(boolean restart)
Boolean minimize(boolean restart)
Boolean maximize(Var obj, boolean restart)
Boolean minimize(Var obj, boolean restart)
@Deprecated void setSolutionPoolCapacity(int capacity)
void printRuntimeStatistics()
String runtimeStatistics()
@Deprecated void setLoggingMaxDepth(int loggingMaxDepth)
ChocoLogging
@Deprecated int getLoggingMaxDepth()
ChocoLogging
void worldPush()
void worldPop()
void worldPopUntil(int n)
n
- number of world to popvoid worldPushDuringPropagation()
void worldPopDuringPropagation()
Solution recordSolution()
void setSolutionDisplay(ISolutionDisplay solutionDisplay)
solutionDisplay
- the solution printervoid restoreSolution(Solution sol)
sol
- solution to restoreConfiguration getConfiguration()
IEnvironment getEnvironment()
void setFeasible(Boolean b)
int getWorldIndex()
void eraseConstraint(SConstraint c)
int getNbConstraints()
int getNbIntConstraints()
@Deprecated AbstractIntSConstraint getIntConstraint(int i)
i
- index of the constraint in the model
IntExp plus(IntExp v1, int v2)
IntExp plus(int v1, IntExp v2)
IntExp plus(IntExp v1, IntExp v2)
SConstraint lt(IntExp x, int c)
SConstraint lt(int c, IntExp x)
SConstraint lt(IntExp x, IntExp y)
SConstraint leq(IntExp x, int c)
SConstraint leq(int c, IntExp x)
SConstraint leq(IntExp x, IntExp y)
SConstraint geq(IntExp x, int c)
SConstraint geq(int c, IntExp x)
SConstraint geq(IntExp x, IntExp y)
SConstraint eq(IntExp x, IntExp y)
SConstraint eq(IntExp x, int c)
SConstraint eq(int c, IntExp x)
SConstraint eq(RealVar r, IntDomainVar i)
SConstraint gt(IntExp x, IntExp y)
SConstraint gt(IntExp x, int c)
SConstraint gt(int c, IntExp x)
SConstraint neq(IntExp x, int c)
SConstraint neq(int c, IntExp x)
SConstraint neq(IntExp x, IntExp y)
IntExp scalar(int[] lc, IntDomainVar[] lv)
IntExp scalar(IntDomainVar[] lv, int[] lc)
IntExp sum(IntExp... lv)
void read(Model m)
Boolean solve(boolean all)
Boolean solve()
Boolean solveAll()
Boolean isFeasible()
Boolean checkSolution()
Boolean nextSolution()
<MV extends Variable,SV extends Var> SV _to(MV mv, SV sv)
<MV extends Variable,SV extends Var> SV[] _to(MV[] mv, SV[] sv)
<MV extends Variable,SV extends Var> SV getVar(MV v)
<MV extends Variable,SV extends Var> SV[] getVar(Class<SV> clazz, MV[] mv)
IntDomainVar getVar(IntegerVariable v)
IntDomainVar[] getVar(IntegerVariable... v)
RealVar getVar(RealVariable v)
RealVar[] getVar(RealVariable... v)
SetVar getVar(SetVariable v)
SetVar[] getVar(SetVariable... v)
TaskVar getVar(TaskVariable v)
TaskVar[] getVar(TaskVariable... v)
SConstraint getCstr(Constraint ic)
void setIlogGoal(Goal ilogGoal)
IntDomainVar createIntVar(String name, int domainType, int min, int max)
IntDomainVar createBooleanVar(String name)
IntDomainVar createEnumIntVar(String name, int min, int max)
IntDomainVar createBoundIntVar(String name, int min, int max)
IntDomainVar createBinTreeIntVar(String name, int min, int max)
IntDomainVar createEnumIntVar(String name, int[] sortedValues)
IntDomainVar createBinTreeIntVar(String name, int[] sortedValues)
RealVar createRealVal(String name, double min, double max)
RealConstant createRealIntervalConstant(double a, double b)
RealConstant cst(double d)
d
- double
RealConstant cst(double a, double b)
a
- lower boundb
- upper bound
SetVar createSetVar(String name, int a, int b, int domainType)
SetVar createBoundSetVar(String name, int a, int b)
SetVar createEnumSetVar(String name, int a, int b)
TaskVar createTaskVar(String name, IntDomainVar start, IntDomainVar end, IntDomainVar duration)
IntDomainVar createIntegerConstant(String name, int val)
RealConstant createRealConstant(String name, double val)
@Deprecated void setCardReasoning(boolean creas)
LargeRelation makeLargeRelation(int[] min, int[] max, List<int[]> tuples, boolean feas)
LargeRelation makeLargeRelation(int[] min, int[] max, List<int[]> tuples, boolean feas, int scheme)
BinRelation makeBinRelation(int[] min, int[] max, List<int[]> mat, boolean feas, boolean bitset)
BinRelation makeBinRelation(int[] min, int[] max, List<int[]> mat, boolean feas)
SConstraint relationTupleAC(IntDomainVar[] vs, LargeRelation rela)
SConstraint relationTupleAC(IntDomainVar[] vs, LargeRelation rela, int ac)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |