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

protected class RandomShrinkSearch.ShrinkSearcher extends RandomShrinkSearch.RandomSearcher
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 Details

    • variableWindows

      protected Map<Variable,xal.extension.solver.algorithm.VariableWindow> 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:
      reset in interface RandomShrinkSearch.Searcher
      Overrides:
      reset in class RandomShrinkSearch.RandomSearcher
    • getSearchWindow

      public xal.extension.solver.algorithm.VariableWindow getSearchWindow(Variable variable)
      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

      public void printVariableSearchWindows(String message)
      Print variables' search windows.
    • newTopSolution

      public void newTopSolution(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.
      Specified by:
      newTopSolution in interface RandomShrinkSearch.Searcher
      Overrides:
      newTopSolution in class RandomShrinkSearch.RandomSearcher
      Parameters:
      oldPoint - The old best point.
      newPoint - The new best point.
    • shiftWindow

      public void shiftWindow(TrialPoint newPoint)
    • 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

      protected double proposeValue(Variable variable)
      Propose a new value for the variable by selecting a random value from the variable's shrunken search space.
      Overrides:
      proposeValue in class RandomShrinkSearch.RandomSearcher
      Parameters:
      variable - the variable for which to propose a new value
      Returns:
      the new value to propose for the variable