Class AlgorithmSchedule

java.lang.Object
xal.extension.solver.AlgorithmSchedule

public class AlgorithmSchedule extends Object
AlgorithmSchedule keeps track of and executes the next algorithm based on its score. Schedule also sets a trial and a stopper.
Author:
ky6, t6p
  • Field Details

    • stopper

      protected volatile Stopper stopper
      determines when to stop the trials
    • problem

      protected Problem problem
      the problem to solve
    • market

      protected AlgorithmMarket market
      the market of algorithm runs
    • solver

      protected Solver solver
      the solver running the schedule
  • Constructor Details

    • AlgorithmSchedule

      public AlgorithmSchedule(Solver solver, AlgorithmMarket market, Stopper stopper)
      Creates a new instance of Schedule.
      Parameters:
      solver - The solver
      market - The market providing runs.
      stopper - The stopper which can terminate the schedule.
  • Method Details

    • reset

      public void reset()
      Reset the algorithm run stack.
    • addAlgorithmScheduleListener

      public void addAlgorithmScheduleListener(AlgorithmScheduleListener aListener)
      Add an algorithm schedule listener.
      Parameters:
      aListener - The listener to add.
    • removeAlgorithmScheduleListener

      public void removeAlgorithmScheduleListener(AlgorithmScheduleListener aListener)
      Remove an algorithm schedule listener.
      Parameters:
      aListener - The listener to remove.
    • getMarket

      public AlgorithmMarket getMarket()
      Get the algorithm market.
      Returns:
      the algorithm market
    • getScoreBoard

      public ScoreBoard getScoreBoard()
      get the score board
    • setProblem

      public void setProblem(Problem problem)
      Assign a new problem.
      Parameters:
      problem - the new problem
    • getStopper

      public Stopper getStopper()
      Get the stopper.
      Returns:
      the stopper
    • setStopper

      public void setStopper(Stopper stopper)
      Assign a new stopper.
      Parameters:
      stopper - the new stopper
    • shouldExecute

      public boolean shouldExecute()
      Determine whether to continue executing the schedule.
      Returns:
      true if the stopper allows us to continue executing the schedule and false if not
    • shouldStop

      public boolean shouldStop()
      Allows the algorithms to check when they should stop executing their code
    • execute

      public void execute()
      Execute the search schedule.
    • evaluateTrialPoint

      public Trial evaluateTrialPoint(SearchAlgorithm searchAlgorithm, TrialPoint trialPoint)
      Evaluate the specified trial point or return null if the run has been terminated.
      Parameters:
      trialPoint - the trial point to evaluate
      Returns:
      a scored trial corresponding to the specified trial point
      Throws:
      RunTerminationException - if the run has been terminated