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.
|
double |
getAdvancedParam(java.lang.String key,
double defaultValue)
Reserved for maintenance purpose.
|
int |
getAdvancedParam(java.lang.String key,
int defaultValue)
Reserved for maintenance purpose.
|
java.lang.String |
getAdvancedParam(java.lang.String key,
java.lang.String defaultValue)
Reserved for maintenance purpose.
|
int |
getAnnealingLevel()
Deprecated.
As of 8.5, this parameter doesn't have a significant influence on
the search anymore. The tuning of this parameter won't be allowed
in a future version.
|
double |
getDoubleObjectiveThreshold(int objectiveIndex)
Gets the threshold of the objective with the given index.
|
long |
getIntObjectiveThreshold(int objectiveIndex)
Gets the threshold of the objective with the given index.
|
long |
getIterationBetweenTicks()
Gets the number of iterations between two events of type
LSCallbackType.IterationTicked. |
long |
getIterationLimit()
Gets the maximum number of iterations.
|
LocalSolver |
getLocalSolver()
Returns the LocalSolver object associated to these parameters.
|
java.lang.String |
getLogFile()
Returns the path of the LocalSolver log file.
|
java.io.Writer |
getLogWriter()
Returns the writer used by LocalSolver for its logging.
|
int |
getNbThreads()
Gets the number of threads (0 coding for automatic setting).
|
long |
getObjectiveThreshold(int objectiveIndex)
Gets the threshold 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 |
getTimeBetweenTicks()
Gets the time in seconds between two events of type
LSCallbackType.TimeTicked. |
int |
getTimeLimit()
Gets the time limit in seconds.
|
int |
getVerbosity()
Gets the verbosity level of the solver.
|
int |
hashCode() |
void |
setAdvancedParam(java.lang.String key,
double value)
Reserved for maintenance purpose.
|
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)
Reserved for maintenance purpose.
|
void |
setAnnealingLevel(int annealingLevel)
Deprecated.
As of 8.5, this parameter doesn't have a significant influence on
the search anymore. The tuning of this parameter won't be allowed
in a future version.
|
void |
setDoubleObjectiveThreshold(int objectiveIndex,
double threshold)
Sets the threshold of the objective with the given index.
|
void |
setIntObjectiveThreshold(int objectiveIndex,
long threshold)
Sets the threshold of the objective with the given index.
|
void |
setIterationBetweenTicks(long iterationBetweenTicks)
Sets the number of iterations between two events of type
LSCallbackType.IterationTicked. |
void |
setIterationLimit(long iterationLimit)
Sets the maximum number of iterations.
|
void |
setLogFile(java.lang.String path)
Sets the path of the LocalSolver log file.
|
void |
setLogWriter(java.io.Writer writer)
Sets the writer used by LocalSolver for its logging.
|
void |
setNbThreads(int nbThreads)
Sets the number of threads used to parallelize the search.
|
void |
setObjectiveThreshold(int objectiveIndex,
double threshold)
Sets the threshold of the objective with the given index.
|
void |
setObjectiveThreshold(int objectiveIndex,
long threshold)
Sets the threshold 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 |
setTimeBetweenTicks(int timeBetweenTicks)
Sets the time in seconds between two events of type
LSCallbackType.TimeTicked. |
void |
setTimeLimit(int timeLimit)
Sets the time limit in seconds.
|
void |
setVerbosity(int verbosity)
Sets the verbosity level of the solver.
|
java.lang.String |
toString()
Returns a String representation of these parameters.
|
public LocalSolver getLocalSolver()
public void setSeed(int seed)
LSState.Modeling or 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()
setSeed(int)public void setNbThreads(int nbThreads)
LSState.Modeling or LSState.Stopped. This parameter is
indicative, if needed LocalSolver may use more threads. The actual number
of threads can also vary during the search.nbThreads - Number of threads.public int getNbThreads()
setNbThreads(int)public void setTimeLimit(int timeLimit)
LSState.Modeling or LSState.Stopped.timeLimit - Time limit in seconds.LSPhasepublic int getTimeLimit()
setTimeLimit(int),
LSPhasepublic void setIterationLimit(long iterationLimit)
LSState.Modeling or LSState.Stopped.iterationLimit - Iteration limit.LSPhasepublic long getIterationLimit()
setIterationLimit(long),
LSPhase@Deprecated public void setAnnealingLevel(int annealingLevel)
LSState.Modeling or LSState.Stopped.annealingLevel - Simulated annealing level.@Deprecated public int getAnnealingLevel()
setAnnealingLevel(int)public void setVerbosity(int verbosity)
LSState.Modeling or LSState.Stopped.verbosity - Verbosity level: 0, 1, 2.public int getVerbosity()
setVerbosity(int)public void setTimeBetweenDisplays(int timeBetweenDisplays)
LSState.Modeling or LSState.Stopped.timeBetweenDisplays - Time in seconds between displays.public int getTimeBetweenDisplays()
setTimeBetweenDisplays(int)public void setTimeBetweenTicks(int timeBetweenTicks)
LSCallbackType.TimeTicked. The default time between ticks is set to 1
second. Only allowed in states LSState.Modeling or LSState.Stopped.timeBetweenTicks - Time in seconds between ticks.public int getTimeBetweenTicks()
LSCallbackType.TimeTicked.setTimeBetweenTicks(int)public void setIterationBetweenTicks(long iterationBetweenTicks)
LSCallbackType.IterationTicked. The default number of iterations
between ticks is set to 10,000. Only allowed in states
LSState.Modeling or LSState.Stopped.iterationBetweenTicks - Number of iterations between ticks.public long getIterationBetweenTicks()
LSCallbackType.IterationTicked.setIterationBetweenTicks(long)public void setLogFile(java.lang.String path)
setVerbosity(int). The verbosity is common to
both the standard output and the log file.
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(),
setLogWriter(java.io.Writer)public void setLogWriter(java.io.Writer writer)
setVerbosity(int). Note that you can
specify both the log writer and the log file by using the method
setLogFile(java.lang.String).writer - Writer to use for the logging or null to restore the default writer.public java.io.Writer getLogWriter()
setVerbosity(int).setLogWriter(java.io.Writer)public java.lang.String getLogFile()
setLogFile(java.lang.String)public void setObjectiveThreshold(int objectiveIndex,
long threshold)
LSState.Stopped.
This method has the same behavior as setIntObjectiveThreshold(int, long).objectiveIndex - Index of the objective.threshold - Objective threshold.LSExpression.isObjective(),
LSExpression.isInt()public void setObjectiveThreshold(int objectiveIndex,
double threshold)
LSState.Stopped.
This method has the same behavior as setDoubleObjectiveThreshold(int, double).objectiveIndex - Index of the objective.threshold - Objective threshold.LSExpression.isObjective(),
LSExpression.isDouble()public void setIntObjectiveThreshold(int objectiveIndex,
long threshold)
LSState.Stopped.objectiveIndex - Index of the objective.threshold - Objective threshold.LSExpression.isObjective(),
LSExpression.isInt()public void setDoubleObjectiveThreshold(int objectiveIndex,
double threshold)
LSState.Stopped.objectiveIndex - Index of the objective.threshold - Objective threshold.LSExpression.isObjective(),
LSExpression.isDouble()public long getObjectiveThreshold(int objectiveIndex)
LSState.Paused or LSState.Stopped.objectiveIndex - Index of the objective.setObjectiveThreshold(int, long)public long getIntObjectiveThreshold(int objectiveIndex)
LSState.Paused or LSState.Stopped.objectiveIndex - Index of the objective.setObjectiveThreshold(int, long)public double getDoubleObjectiveThreshold(int objectiveIndex)
LSState.Paused or LSState.Stopped.objectiveIndex - Index of the objective.setObjectiveThreshold(int, double)public void setAdvancedParam(java.lang.String key,
int value)
LSState.Modeling or LSState.Stopped.key - Name of the parameter.value - Value of the parameter.public int getAdvancedParam(java.lang.String key)
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,
double value)
LSState.Modeling or LSState.Stopped.key - Name of the parameter.value - Value of the parameter.public double getAdvancedParam(java.lang.String key,
double defaultValue)
key - Name of the parameter.defaultValue - Default value of the parameter.setAdvancedParam(String, double)public void setAdvancedParam(java.lang.String key,
java.lang.String value)
LSState.Modeling or 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