public class RandomShrinkSearch extends SearchAlgorithm
Modifier and Type | Class and Description |
---|---|
class |
RandomShrinkSearch.ComboSearcher
Use a combination of search engines to search for the best solution.
|
protected class |
RandomShrinkSearch.RandomSearcher
A searcher that performs a simple random search in the entire search space.
|
protected static interface |
RandomShrinkSearch.Searcher
Interface for classes that search for solutions.
|
protected class |
RandomShrinkSearch.ShrinkSearcher
ShrinkSearcher searches for the next trial point by adjusting the search domain per
variable depending on how much a variable has changed between the best solutions found so
far.
|
Modifier and Type | Field and Description |
---|---|
protected TrialPoint |
_bestPoint
The current best point.
|
protected RandomShrinkSearch.Searcher |
_searcher
The active search technique (random or shrink).
|
_eventProxy, _messageCenter, _problem
Constructor and Description |
---|
RandomShrinkSearch()
Empty constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
algorithmAvailable(SearchAlgorithm source)
Handle a message that an algorithm is available.
|
void |
algorithmUnavailable(SearchAlgorithm source)
Handle a message that an algorithm is not available.
|
void |
foundNewOptimalSolution(SolutionJudge source,
java.util.List<Trial> solutions,
Trial solution)
Handle a message that a new optimal solution has been found.
|
java.lang.String |
getLabel()
Get the label for this search algorithm.
|
int |
globalRating()
Get the rating for this algorithm which in an integer between 0 and 10 and indicates how well this algorithm
performs on global searches.
|
int |
localRating()
Get the rating for this algorithm which in an integer between 0 and 10 and indicates how well this algorithm
performs on local searches.
|
TrialPoint |
nextTrialPoint()
Calculate and get the next trial point to evaluate.
|
void |
performRun(AlgorithmRun algorithmRun)
Calculate the next few trial points.
|
void |
reset()
reset for searching from scratch; forget history
|
protected void |
resetBestPoint()
Reset the trial point's variables to their starting values.
|
void |
setProblem(Problem problem)
Set the specified problem to solve.
|
addSearchAlgorithmListener, getMaxEvaluationsPerRun, getMinEvaluationsPerRun, removeSearchAlgorithmListener, strategyExecuted, strategyWillExecute, trialScored, trialVetoed
protected TrialPoint _bestPoint
protected RandomShrinkSearch.Searcher _searcher
public void setProblem(Problem problem)
setProblem
in class SearchAlgorithm
problem
- the problem to solvepublic java.lang.String getLabel()
getLabel
in class SearchAlgorithm
public void reset()
reset
in class SearchAlgorithm
protected void resetBestPoint()
public void performRun(AlgorithmRun algorithmRun)
performRun
in class SearchAlgorithm
algorithmRun
- the algorithm run to perform the evaluationpublic TrialPoint nextTrialPoint()
public int globalRating()
public int localRating()
public void algorithmAvailable(SearchAlgorithm source)
source
- The source of the available algorithm.public void algorithmUnavailable(SearchAlgorithm source)
source
- The source of the available algorithm.public void foundNewOptimalSolution(SolutionJudge source, java.util.List<Trial> solutions, Trial solution)
foundNewOptimalSolution
in interface SolutionJudgeListener
foundNewOptimalSolution
in class SearchAlgorithm
source
- The source of the new optimal solution.solutions
- The list of solutions.solution
- The new optimal solution.