Package org.moeaframework.problem
Class RotatedProblem
java.lang.Object
org.moeaframework.problem.ProblemWrapper
org.moeaframework.problem.RotatedProblem
- All Implemented Interfaces:
AutoCloseable
,Problem
Decorator to create rotated variants of test problems. The rotation is defined by a rotation matrix, which should
be orthogonal and have a determinant of 1. See
RotationMatrixBuilder
for a utility to quickly construct
rotation matrices.
Regardless of the rotation, all rotated instances use expanded lower and upper bounds for the decision variables. An additional constraint is added to account for solutions existing in this expanded region, which are not in the original unrotated problem. This expansion is consistent across all rotations, which ensures the volume of the constraint-violating expanded region is constant across all instances of a problem.
-
Field Summary
Fields inherited from class org.moeaframework.problem.ProblemWrapper
problem
-
Constructor Summary
ConstructorDescriptionRotatedProblem
(Problem problem, org.apache.commons.math3.linear.RealMatrix rotation) Decorates the specified problem, creating a rotated instance using the specified rotation matrix. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Evaluates the solution, updating the solution's objectives in place.getName()
Returns the user-friendly name for this problem.int
Returns the number of constraints defined by this problem.Returns a new solution for this problem.Methods inherited from class org.moeaframework.problem.ProblemWrapper
close, getNumberOfObjectives, getNumberOfVariables
-
Constructor Details
-
RotatedProblem
Decorates the specified problem, creating a rotated instance using the specified rotation matrix.- Parameters:
problem
- the original unrotated problemrotation
- the rotation matrix
-
-
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
-
getNumberOfConstraints
public int getNumberOfConstraints()Description copied from interface:Problem
Returns the number of constraints defined by this problem.- Specified by:
getNumberOfConstraints
in interfaceProblem
- Overrides:
getNumberOfConstraints
in classProblemWrapper
- Returns:
- the number of constraints defined by 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
-
newSolution
Description copied from interface:Problem
Returns a new solution for this problem. Implementations must initialize the variables so that the valid range of values is defined, but typically leave the actual value at a default or undefined state.- Specified by:
newSolution
in interfaceProblem
- Overrides:
newSolution
in classProblemWrapper
- Returns:
- a new solution for this problem
-