Package xal.extension.solver.algorithm
Class RandomShrinkSearch.ComboSearcher
java.lang.Object
xal.extension.solver.algorithm.RandomShrinkSearch.RandomSearcher
xal.extension.solver.algorithm.RandomShrinkSearch.ComboSearcher
- All Implemented Interfaces:
RandomShrinkSearch.Searcher
- Enclosing class:
- RandomShrinkSearch
Use a combination of search engines to search for the best solution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RandomShrinkSearch.RandomSearcherDescription of the Fieldprotected static final doubleDescription of the Fieldprotected RandomShrinkSearch.ShrinkSearcherDescription of the FieldFields inherited from class xal.extension.solver.algorithm.RandomShrinkSearch.RandomSearcher
changeProbabilityBase, numVariables, randomGenerator, values -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidnewTopSolution(TrialPoint oldPoint, TrialPoint newPoint) An event indicating that a new solution has been found which is better than the previous best solution according to the score given by the evaluator.protected doubleproposeValue(Variable variable) Propose a new value for the variable by picking a search engine to propose a new value.voidreset()reset for searching from scratch; forget historyvoidturns shouldShift onMethods inherited from class xal.extension.solver.algorithm.RandomShrinkSearch.RandomSearcher
nextPoint, nextPoint, nextTrialPoint
-
Field Details
-
shrinkSearcher
Description of the Field -
randomSearcher
Description of the Field -
SHRINK_THRESHOLD
protected static final double SHRINK_THRESHOLDDescription of the Field- See Also:
-
-
Constructor Details
-
ComboSearcher
public ComboSearcher()Constructor
-
-
Method Details
-
shouldShift
public void shouldShift()turns shouldShift on- Specified by:
shouldShiftin interfaceRandomShrinkSearch.Searcher- Overrides:
shouldShiftin classRandomShrinkSearch.RandomSearcher
-
reset
public void reset()reset for searching from scratch; forget history- Specified by:
resetin interfaceRandomShrinkSearch.Searcher- Overrides:
resetin classRandomShrinkSearch.RandomSearcher
-
newTopSolution
An event indicating that a new solution has been found which is better than the previous best solution according to the score given by the evaluator.- Specified by:
newTopSolutionin interfaceRandomShrinkSearch.Searcher- Overrides:
newTopSolutionin classRandomShrinkSearch.RandomSearcher- Parameters:
oldPoint- The old best point.newPoint- The new best point.
-
proposeValue
Propose a new value for the variable by picking a search engine to propose a new value.- Overrides:
proposeValuein classRandomShrinkSearch.RandomSearcher- Parameters:
variable- the variable for which to propose a new value- Returns:
- the new value to propose for the variable
-