Class TimingProblem

java.lang.Object
org.moeaframework.problem.ProblemWrapper
org.moeaframework.problem.TimingProblem
All Implemented Interfaces:
AutoCloseable, Problem

public class TimingProblem extends ProblemWrapper
Wraps a problem to collect objective function evaluation timing data. Precision and accuracy of the timing data is dependent on System.nanoTime().
  • Constructor Details

    • TimingProblem

      public TimingProblem(Problem problem)
      Decorates the specified problem to collecting objective function evaluation timing data.
      Parameters:
      problem - the problem to decorate
  • Method Details

    • evaluate

      public void evaluate(Solution solution)
      Description copied from interface: Problem
      Evaluates the solution, updating the solution's objectives in place. Algorithms must explicitly call this method when appropriate to evaluate new solutions or reevaluate modified solutions.
      Specified by:
      evaluate in interface Problem
      Overrides:
      evaluate in class ProblemWrapper
      Parameters:
      solution - the solution to be evaluated
    • clear

      public void clear()
      Clears any timing data collected.
    • getNanoseconds

      public long getNanoseconds()
      Returns the time, in nanoseconds, expended on objective function evaluation.
      Returns:
      the time, in nanoseconds, expended on objective function evaluation
    • getSeconds

      public double getSeconds()
      Returns the time, in seconds, expended on objective function evaluation.
      Returns:
      the time, in seconds, expended on objective function evaluation
    • getNFE

      public int getNFE()
      Returns the number of times the objective function was evaluated.
      Returns:
      the number of times the objective function was evaluated