Class ScaledProblem

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

public class ScaledProblem extends ProblemWrapper
Decorator to create scaled variants of problems. The i-th objective is scaled by a factor of base^i. This can be used to determine if an algorithm is able to handle objectives of varying magnitudes.

Use loadScaledReferenceSet(File) or createScaledReferenceSet(File, File) to convert the original Pareto front file into the scaled version.

  • Constructor Details

    • ScaledProblem

      public ScaledProblem(Problem problem, double base)
      Constructs a new scaled problem.
      Parameters:
      problem - the original, unscaled problem
      base - the base for scaling
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Problem
      Returns the user-friendly name for this problem.
      Specified by:
      getName in interface Problem
      Overrides:
      getName in class ProblemWrapper
      Returns:
      the user-friendly name for this problem
    • 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
    • loadScaledReferenceSet

      public NondominatedPopulation loadScaledReferenceSet(File file) throws IOException
      Loads the reference set file and scales the solutions.
      Parameters:
      file - the reference set file
      Returns:
      the scaled reference set
      Throws:
      IOException - if an I/O error occurred
    • createScaledReferenceSet

      public void createScaledReferenceSet(File file, File scaledFile) throws IOException
      Converts a reference set into its scaled version.
      Parameters:
      file - the original, unscaled reference set file
      scaledFile - the scaled reference set file
      Throws:
      IOException - if an I/O error occurred