Package org.moeaframework.problem
Class ScaledProblem
java.lang.Object
org.moeaframework.problem.ProblemWrapper
org.moeaframework.problem.ScaledProblem
- All Implemented Interfaces:
AutoCloseable
,Problem
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.
-
Field Summary
Fields inherited from class org.moeaframework.problem.ProblemWrapper
problem
-
Constructor Summary
ConstructorDescriptionScaledProblem
(Problem problem, double base) Constructs a new scaled problem. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createScaledReferenceSet
(File file, File scaledFile) Converts a reference set into its scaled version.void
Evaluates the solution, updating the solution's objectives in place.getName()
Returns the user-friendly name for this problem.loadScaledReferenceSet
(File file) Loads the reference set file and scales the solutions.Methods inherited from class org.moeaframework.problem.ProblemWrapper
close, getNumberOfConstraints, getNumberOfObjectives, getNumberOfVariables, newSolution
-
Constructor Details
-
ScaledProblem
Constructs a new scaled problem.- Parameters:
problem
- the original, unscaled problembase
- the base for scaling
-
-
Method Details
-
getName
Description copied from interface:Problem
Returns the user-friendly name for this problem.- Specified by:
getName
in interfaceProblem
- Overrides:
getName
in classProblemWrapper
- Returns:
- the user-friendly name for this problem
-
evaluate
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 interfaceProblem
- Overrides:
evaluate
in classProblemWrapper
- Parameters:
solution
- the solution to be evaluated
-
loadScaledReferenceSet
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
Converts a reference set into its scaled version.- Parameters:
file
- the original, unscaled reference set filescaledFile
- the scaled reference set file- Throws:
IOException
- if an I/O error occurred
-