Class Trial

java.lang.Object
xal.extension.solver.Trial

public class Trial extends Object
Trial keeps track of trial points.
Author:
ky6, t6p
  • Field Details

    • trialPoint

      protected final TrialPoint trialPoint
      trial point of variable values
    • problem

      protected final Problem problem
      the problem being solved
    • searchAlgorithm

      protected final SearchAlgorithm searchAlgorithm
      the algorithm that generated this trial
    • veto

      protected TrialVeto veto
      a veto if any
    • objectiveScores

      protected final Map<Objective,Score> objectiveScores
      table of objective scores
    • satisfaction

      protected double satisfaction
      overall satisfaction provided by some solution judges
    • customInfo

      protected Object customInfo
      optional, custom information that an objective or evaluator may choose to store here for convenience
  • Constructor Details

    • Trial

      public Trial(Problem problem, TrialPoint trialPoint, SearchAlgorithm algorithm)
      Primary Constructor.
      Parameters:
      problem - the problem being solved
      trialPoint - the trial point of variable values
      algorithm - the algorithm that generated this trial
    • Trial

      public Trial(Problem problem, TrialPoint trialPoint)
      Constructor.
      Parameters:
      problem - the problem being solved
      trialPoint - the trial point of variable values
  • Method Details

    • vetoTrial

      public void vetoTrial(TrialVeto veto)
      Veto the trial.
      Parameters:
      veto - the veto
    • getVeto

      public TrialVeto getVeto()
      Get the trial veto if any
      Returns:
      the trial veto or null if there is none
    • isVetoed

      public boolean isVetoed()
      Determine if this trial has been vetoed
      Returns:
      true if the trial has been vetoed and false if not
    • setScore

      public void setScore(Score score)
      Set the scores of a trial point.
      Parameters:
      score - The new score value
    • setScore

      public void setScore(Objective objective, double value)
      Set the scores of a trial point.
      Parameters:
      objective - The new score value
      value - The new score value
    • getScore

      public Score getScore(Objective objective)
      Get the score corresponding to the specified objective.
      Parameters:
      objective - Description of the Parameter
      Returns:
      The score of the specified objective.
    • getSatisfaction

      public double getSatisfaction(Objective objective)
      Get the satisfaction for a specific objective.
      Parameters:
      objective - The objective to get.
      Returns:
      The satisfaction.
    • setSatisfaction

      public void setSatisfaction(double satisfaction)
      Specify the overall satisfaction of this solution.
      Parameters:
      satisfaction - the overall satisfaction of this solution
    • getSatisfaction

      public double getSatisfaction()
      Get the overall satisfaction which many solution judges provide.
      Returns:
      the overall satisfaction of this solution
    • getProblem

      public Problem getProblem()
      Get the problem.
      Returns:
      The problem.
    • getTrialPoint

      public TrialPoint getTrialPoint()
      Get the trial point.
      Returns:
      The trial point.
    • getAlgorithm

      public SearchAlgorithm getAlgorithm()
      Get the search algorithm that generated this trial.
      Returns:
      The search algorithm.
    • getScores

      public Map<Objective,Score> getScores()
      Get the scores keyed by objective
      Returns:
      Table of scores keyed by objective.
    • getCustomInfo

      public Object getCustomInfo()
      Get optional, custom information (if any) that was provided for convenience.
      Returns:
      optional, custom information
    • setCustomInfo

      public void setCustomInfo(Object customInfo)
      Provide optional, custom information for convenience
      Parameters:
      customInfo - the custom information to provide
    • toString

      public String toString()
      A string for displaying a trial. The string consist of a trial point and a score.
      Overrides:
      toString in class Object
      Returns:
      The string representation of a trial.