localsolver
public class LSParam extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
getAdvancedParam(java.lang.String key)
Returns the value of an advanced parameter.
|
int |
getAdvancedParam(java.lang.String key,
int defaultValue)
Returns the value of an advanced parameter.
|
java.lang.String |
getAdvancedParam(java.lang.String key,
java.lang.String defaultValue)
Returns the value of an advanced parameter.
|
int |
getAnnealingLevel()
Gets the simulated annealing level.
|
double |
getDoubleObjectiveBound(int objectiveIndex)
Gets the bound of the objective with the given index.
|
long |
getIntObjectiveBound(int objectiveIndex)
Gets the bound of the objective with the given index.
|
LocalSolver |
getLocalSolver() |
java.lang.String |
getLogFile()
Returns the path of the LocalSolver log file.
|
int |
getNbThreads()
Gets the number of threads.
|
long |
getObjectiveBound(int objectiveIndex)
Gets the bound of the objective with the given index.
|
int |
getSeed()
Gets the seed of the pseudo-random number generator used by the solver.
|
int |
getTimeBetweenDisplays()
Gets the time in seconds between two consecutive displays in console while the solver is running.
|
int |
getVerbosity()
Gets the verbosity level of the solver.
|
int |
hashCode() |
void |
setAdvancedParam(java.lang.String key,
int value)
Sets the value of an advanced parameter.
|
void |
setAdvancedParam(java.lang.String key,
java.lang.String value)
Sets the value of an advanced parameter.
|
void |
setAnnealingLevel(int annealingLevel)
Sets the simulated annealing level.
|
void |
setDoubleObjectiveBound(int objectiveIndex,
double bound)
Sets the bound of the objective with the given index.
|
void |
setIntObjectiveBound(int objectiveIndex,
long bound)
Sets the bound of the objective with the given index.
|
void |
setLogFile(java.lang.String path)
Sets the path of the LocalSolver log file.
|
void |
setNbThreads(int nbThreads)
Sets the number of threads used to parallelize the search.
|
void |
setObjectiveBound(int objectiveIndex,
double bound)
Sets the bound of the objective with the given index.
|
void |
setObjectiveBound(int objectiveIndex,
long bound)
Sets the bound of the objective with the given index.
|
void |
setSeed(int seed)
Sets the seed of the pseudo-random number generator used by the solver.
|
void |
setTimeBetweenDisplays(int timeBetweenDisplays)
Sets the time in seconds between two consecutive displays in console while the solver is running.
|
void |
setVerbosity(int verbosity)
Sets the verbosity level of the solver.
|
java.lang.String |
toString() |
public LocalSolver getLocalSolver()
public void setSeed(int seed)
LSState.Stopped.
The search for solutions is highly randomized. Fixing the seed and the
number of iterations of the solver allows you to reproduce exactly its
results over several runs.seed - Seed of the pseudo-random number generator.public int getSeed()
LSState.Paused or LSState.Stopped.setSeed(int)public void setNbThreads(int nbThreads)
LSState.Stopped.
By increasing the number of threads, you increase the robustness of the solver (that is, the
chance to find better solutions). However, we recommend you to avoid running a number of threads
which exceeds the number of cores available on your machine. Since the performance of the solver
is sensible to the number of cache misses, the recommended ratio for maximizing its efficiency is
to launch at most k/2 searches with k the number of cores of your hardware.nbThreads - Number of threads.public int getNbThreads()
LSState.Paused or LSState.Stopped.setNbThreads(int)public void setAnnealingLevel(int annealingLevel)
LSState.Stopped.
If set to 0, the search heuristic is equivalent to a standard descent: moves deteriorating the current
solution are rejected. By increasing this parameter, you increase the number of uphill moves (that is,
moves deteriorating the objective value of the current solution): this increases chances to reach better
solutions (diversification), but slows the convergence of the search.annealingLevel - Simulated annealing level.public int getAnnealingLevel()
LSState.Paused or LSState.Stopped.setAnnealingLevel(int)public void setVerbosity(int verbosity)
verbosity - Verbosity level: 0, 1, 2.public int getVerbosity()
setVerbosity(int)public void setObjectiveBound(int objectiveIndex,
long bound)
LSState.Stopped.
This method has the same behavior as setIntObjectiveBound(int, long).objectiveIndex - Index of the objective.bound - Objective bound.LSExpression.isObjective(),
LSExpression.isInt()public void setObjectiveBound(int objectiveIndex,
double bound)
LSState.Stopped.
This method has the same behavior as setDoubleObjectiveBound(int, double).objectiveIndex - Index of the objective.bound - Objective bound.LSExpression.isObjective(),
LSExpression.isDouble()public void setIntObjectiveBound(int objectiveIndex,
long bound)
LSState.Stopped.objectiveIndex - Index of the objective.bound - Objective bound.LSExpression.isObjective(),
LSExpression.isInt()public void setDoubleObjectiveBound(int objectiveIndex,
double bound)
LSState.Stopped.objectiveIndex - Index of the objective.bound - Objective bound.LSExpression.isObjective(),
LSExpression.isDouble()public long getObjectiveBound(int objectiveIndex)
LSState.Paused or LSState.Stopped.objectiveIndex - Index of the objective.setObjectiveBound(int, long)public long getIntObjectiveBound(int objectiveIndex)
LSState.Paused or LSState.Stopped.objectiveIndex - Index of the objective.setObjectiveBound(int, long)public double getDoubleObjectiveBound(int objectiveIndex)
LSState.Paused or LSState.Stopped.objectiveIndex - Index of the objective.setObjectiveBound(int, long)public void setTimeBetweenDisplays(int timeBetweenDisplays)
LSState.Stopped.timeBetweenDisplays - Time in seconds between displays.public int getTimeBetweenDisplays()
LSState.Paused or LSState.Stopped.setTimeBetweenDisplays(int)public void setLogFile(java.lang.String path)
setVerbosity(int).
Only allowed in states LSState.Stopped or LSState.Modeling.path - Path of the log file. Leave empty to disable the logging mechanism.setVerbosity(int),
getLogFile()public java.lang.String getLogFile()
setLogFile(java.lang.String)public void setAdvancedParam(java.lang.String key,
int value)
LSState.Stopped.key - Name of the parameter.value - Value of the parameter.public int getAdvancedParam(java.lang.String key)
LSState.Paused or LSState.Stopped.key - Name of the parameter.setAdvancedParam(String, int)public int getAdvancedParam(java.lang.String key,
int defaultValue)
key - Name of the parameter.defaultValue - Default value of the parameter.setAdvancedParam(String, int)public void setAdvancedParam(java.lang.String key,
java.lang.String value)
LSState.Stopped.key - Name of the parameter.value - Value of the parameter.public java.lang.String getAdvancedParam(java.lang.String key,
java.lang.String defaultValue)
key - Name of the parameter.defaultValue - Default value of the parameter.setAdvancedParam(String, String)public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object