Package org.moeaframework.problem
Class ProblemStub
java.lang.Object
org.moeaframework.problem.AbstractProblem
org.moeaframework.problem.ProblemStub
- All Implemented Interfaces:
AutoCloseable
,Problem
A problem stub with a defined number of objectives, but no decision variables or constraints. This is often used
by the command-line tools when we only need to know the number of objectives. Calls to
evaluate(Solution)
will throw UnsupportedOperationException
.-
Field Summary
Fields inherited from class org.moeaframework.problem.AbstractProblem
numberOfConstraints, numberOfObjectives, numberOfVariables
-
Constructor Summary
ConstructorDescriptionProblemStub
(int numberOfObjectives) Constructs a problem stub with the specified number of objectives. -
Method Summary
Modifier and TypeMethodDescriptionvoid
ThrowsUnsupportedOperationException
.Returns a new solution for this problem.Methods inherited from class org.moeaframework.problem.AbstractProblem
close, getName, getNumberOfConstraints, getNumberOfObjectives, getNumberOfVariables
-
Constructor Details
-
ProblemStub
public ProblemStub(int numberOfObjectives) Constructs a problem stub with the specified number of objectives.- Parameters:
numberOfObjectives
- the number of objectives
-
-
Method Details
-
evaluate
ThrowsUnsupportedOperationException
.- Parameters:
solution
- the solution to be evaluated- Throws:
UnsupportedOperationException
- always
-
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.- Returns:
- a new solution for this problem
-