Package xal.extension.solver.algorithm
Class RandomShrinkSearch.ShrinkSearcher
java.lang.Object
xal.extension.solver.algorithm.RandomShrinkSearch.RandomSearcher
xal.extension.solver.algorithm.RandomShrinkSearch.ShrinkSearcher
- All Implemented Interfaces:
RandomShrinkSearch.Searcher
- Enclosing class:
- RandomShrinkSearch
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. As the variables converge on a solution,
the search space shrinks. The search space may also increase if a
variable is not converging as we get closer to an optimal solution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionDescription of the FieldFields inherited from class xal.extension.solver.algorithm.RandomShrinkSearch.RandomSearcher
changeProbabilityBase, numVariables, randomGenerator, values -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidBuild the new bounds based upon the user specified domain and the search algorithm's search space per variable.xal.extension.solver.algorithm.VariableWindowgetSearchWindow(Variable variable) Get the variable's search window for the specified variable.voidnewTopSolution(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.voidprintVariableSearchWindows(String message) Print variables' search windows.protected doubleproposeValue(Variable variable) Propose a new value for the variable by selecting a random value from the variable's shrunken search space.voidreset()reset for searching from scratch; forget historyvoidshiftWindow(TrialPoint newPoint) voidturns shouldShift onMethods inherited from class xal.extension.solver.algorithm.RandomShrinkSearch.RandomSearcher
nextPoint, nextPoint, nextTrialPoint, shouldShift
-
Field Details
-
variableWindows
Description of the Field
-
-
Constructor Details
-
ShrinkSearcher
public ShrinkSearcher()Constructor
-
-
Method Details
-
shouldShsift
public void shouldShsift()turns shouldShift on -
reset
public void reset()reset for searching from scratch; forget history- Specified by:
resetin interfaceRandomShrinkSearch.Searcher- Overrides:
resetin classRandomShrinkSearch.RandomSearcher
-
getSearchWindow
Get the variable's search window for the specified variable.- Parameters:
variable- the variable for which to get the search window- Returns:
- the variable's search window
-
printVariableSearchWindows
Print variables' search windows. -
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.
-
shiftWindow
-
buildWindows
protected void buildWindows()Build the new bounds based upon the user specified domain and the search algorithm's search space per variable. The search windows become the intersection of the user specified search domain and the algorithm's search space. -
proposeValue
Propose a new value for the variable by selecting a random value from the variable's shrunken search space.- Overrides:
proposeValuein classRandomShrinkSearch.RandomSearcher- Parameters:
variable- the variable for which to propose a new value- Returns:
- the new value to propose for the variable
-