SolutionType - solution type of the problems that may be solved using this search, required to extend Solutionpublic class RandomSearch<SolutionType extends Solution> extends Search<SolutionType>
| Constructor and Description |
|---|
RandomSearch(Problem<SolutionType> problem)
Create a random search, given the problem to solve.
|
RandomSearch(String name,
Problem<SolutionType> problem)
Create a random search, given the problem to solve and a custom search name.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
searchStep()
In every search step, a random solution is created and the best solution might be updated accordingly.
|
addSearchListener, addStopCriterion, assertIdle, clearSearchListeners, clearStopCriteria, computeDelta, dispose, getBestSolution, getBestSolutionEvaluation, getBestSolutionValidation, getID, getMinDelta, getName, getProblem, getRandom, getRuntime, getSearchListeners, getStatus, getStatusLock, getSteps, getStepsWithoutImprovement, getTimeWithoutImprovement, init, removeSearchListener, removeStopCriterion, run, searchDisposed, searchStarted, searchStopped, setRandom, setStopCriterionCheckPeriod, start, stop, toString, updateBestSolution, updateBestSolutionpublic RandomSearch(Problem<SolutionType> problem)
problem can not be null.
The search name is set to the default name "RandomSearch".problem - problem to solveNullPointerException - if problem is nullpublic RandomSearch(String name, Problem<SolutionType> problem)
problem can
not be null. The search name can be null in which case it is set to the default name
"RandomSearch".problem - problem to solvename - custom search nameNullPointerException - if problem is nullprotected void searchStep()
searchStep in class Search<SolutionType extends Solution>Copyright © 2016. All rights reserved.