SolutionType
- solution type of the problems that may be solved using this search, required to extend Solution
public class ExhaustiveSearch<SolutionType extends Solution> extends Search<SolutionType>
When all solutions have been generated and evaluated, the search stops. If the search is stopped before that time, and subsequently restarted, it will not revisited the part of the solution space that had already been explored before, given that its solution iterator has not been modified externally in between both runs.
Constructor and Description |
---|
ExhaustiveSearch(Problem<SolutionType> problem,
SolutionIterator<? extends SolutionType> solutionIterator)
Create an exhaustive search algorithm to solve the given problem, using the given solution iterator to generate
possible solutions, with default search name "ExhaustiveSearch".
|
ExhaustiveSearch(String name,
Problem<SolutionType> problem,
SolutionIterator<? extends SolutionType> solutionIterator)
Create an exhaustive search algorithm to solve the given problem, using the given solution iterator to generate
possible solutions, with a custom search name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
searchStep()
In every search step it is verified whether there are more solution to be generated using the solution iterator.
|
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, updateBestSolution
public ExhaustiveSearch(Problem<SolutionType> problem, SolutionIterator<? extends SolutionType> solutionIterator)
problem
- problem to solvesolutionIterator
- solution iterator used to generate solutionsNullPointerException
- if problem
or solutionIterator
are null
public ExhaustiveSearch(String name, Problem<SolutionType> problem, SolutionIterator<? extends SolutionType> solutionIterator)
null
, the default name "ExhaustiveSearch"
will be assigned. Note that the problem and solution iterator can not be null, else, an exception will be thrown.name
- custom search nameproblem
- problem to solvesolutionIterator
- solution iterator used to generate solutionsNullPointerException
- if problem
or solutionIterator
are null
protected void searchStep()
searchStep
in class Search<SolutionType extends Solution>
Copyright © 2016. All rights reserved.