|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractEntity
choco.Solver
public class Solver
This class serves both as a factory and as a handler for AbstractGlobalSearchSolvers:
Field Summary | |
---|---|
protected boolean |
doMaximize
Maximization / Minimization problem |
protected boolean |
firstSolution
do we want to explore one or all solutions (default=one solution) |
int |
loggingMaxDepth
maximal search depth for logging statements |
protected int |
nodeLimit
|
protected Var |
objective
The variable modelling the objective function |
static int |
PROPAGATION
|
protected boolean |
restart
Do we want to restart a new search after each solution |
static int |
SEARCH
|
static int |
SILENT
|
static int |
SOLUTION
|
protected AbstractGlobalSearchSolver |
solver
The object controlling the global search exploration |
protected int |
timeLimit
|
protected IValIterator |
valIterator
Value iterator |
protected IValSelector |
valSelector
Value selector |
protected IVarSelector |
varSelector
Variable selector |
Fields inherited from class choco.AbstractEntity |
---|
hook, problem |
Constructor Summary | |
---|---|
Solver(AbstractProblem pb)
|
Method Summary | |
---|---|
void |
addGoal(AbstractIntBranching branching)
|
void |
attachGoal(AbstractIntBranching branching)
|
protected static void |
flushLog(java.util.logging.Logger log)
|
static void |
flushLogs()
|
protected void |
generateGoal(AbstractProblem pb)
|
void |
generateSearchSolver(AbstractProblem pb)
|
IGlobalSearchLimit |
getEncounteredLimit()
If a limit has been encounteres, return the involved limit |
boolean |
getFirstSolution()
|
int |
getNbSolutions()
returns the number of solutions encountered during the search |
java.lang.Number |
getOptimumValue()
|
AbstractGlobalSearchSolver |
getSearchSolver()
|
boolean |
isEncounteredLimit()
Checks if a limit has been encountered |
void |
launch()
commands the solver to start |
void |
setDoMaximize(boolean doMaximize)
a boolean indicating if the solver minize or maximize the objective function |
void |
setFirstSolution(boolean firstSolution)
Sets wether only the first solution must be found |
void |
setLoggingMaxDepth(int loggingMaxDepth)
|
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 |
setRestart(boolean restart)
set the optimization strategy: - restart or not after each solution found |
void |
setTimeLimit(int timeLimit)
Sets the time limit i.e. the maximal time before stopping the search algorithm |
void |
setValIterator(IValIterator valIterator)
Sets the value iterator the search should use |
void |
setValSelector(IValSelector valSelector)
Sets the value selector the search should use |
void |
setVarSelector(IVarSelector varSelector)
Sets the variable selector the search solver should use. |
static void |
setVerbosity(int verbosity)
|
protected static void |
setVerbosity(java.util.logging.Logger logger,
java.util.logging.Level level)
Sets the level of log for the Logger and the Handler. |
Methods inherited from class choco.AbstractEntity |
---|
getProblem, pretty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Var objective
protected boolean doMaximize
public int loggingMaxDepth
protected boolean restart
protected boolean firstSolution
protected AbstractGlobalSearchSolver solver
protected IVarSelector varSelector
protected IValIterator valIterator
protected IValSelector valSelector
protected int timeLimit
protected int nodeLimit
public static final int SILENT
public static final int SOLUTION
public static final int SEARCH
public static final int PROPAGATION
Constructor Detail |
---|
public Solver(AbstractProblem pb)
Method Detail |
---|
public void setLoggingMaxDepth(int loggingMaxDepth)
public AbstractGlobalSearchSolver getSearchSolver()
public void generateSearchSolver(AbstractProblem pb)
protected void generateGoal(AbstractProblem pb)
public void attachGoal(AbstractIntBranching branching)
public void addGoal(AbstractIntBranching branching)
public void launch()
public int getNbSolutions()
public void setTimeLimit(int timeLimit)
public void setNodeLimit(int nodeLimit)
public boolean getFirstSolution()
public void setFirstSolution(boolean firstSolution)
public void setVarSelector(IVarSelector varSelector)
public void setValIterator(IValIterator valIterator)
public void setValSelector(IValSelector valSelector)
public void setRestart(boolean restart)
restart
- public void setDoMaximize(boolean doMaximize)
doMaximize
- public void setObjective(Var objective)
objective
- public java.lang.Number getOptimumValue()
public boolean isEncounteredLimit()
public IGlobalSearchLimit getEncounteredLimit()
public static void setVerbosity(int verbosity)
public static void flushLogs()
protected static void setVerbosity(java.util.logging.Logger logger, java.util.logging.Level level)
logger
- the logger to modify its levellevel
- the new levelprotected static void flushLog(java.util.logging.Logger log)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |