public abstract class AbstractProblem extends java.lang.Object implements Problem
Problem
. For simplicity, most problems should
extend AbstractProblem
rather than implement the Problem
interface directly. At a minimum, only the Problem.newSolution()
and
Problem.evaluate(org.moeaframework.core.Solution)
methods need to be
defined.Modifier and Type | Field and Description |
---|---|
protected int |
numberOfConstraints
The number of constraints defined by this problem.
|
protected int |
numberOfObjectives
The number of objectives defined by this problem.
|
protected int |
numberOfVariables
The number of variables defined by this problem.
|
Constructor and Description |
---|
AbstractProblem(int numberOfVariables,
int numberOfObjectives)
Constructs an unconstrained abstract problem with the specified number
of decision variables and objectives.
|
AbstractProblem(int numberOfVariables,
int numberOfObjectives,
int numberOfConstraints)
Constructs an abstract problem with the specified number of decision
variables, objectives and constraints.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes any underlying resources used by this problem.
|
java.lang.String |
getName()
Returns the user-friendly name for this problem.
|
int |
getNumberOfConstraints()
Returns the number of constraints defined by this problem.
|
int |
getNumberOfObjectives()
Returns the number of objectives defined by this problem.
|
int |
getNumberOfVariables()
Returns the number of decision variables defined by this problem.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evaluate, isType, newSolution
protected final int numberOfVariables
protected final int numberOfObjectives
protected final int numberOfConstraints
public AbstractProblem(int numberOfVariables, int numberOfObjectives)
numberOfVariables
- the number of decision variablesnumberOfObjectives
- the number of objectivespublic AbstractProblem(int numberOfVariables, int numberOfObjectives, int numberOfConstraints)
numberOfVariables
- the number of decision variablesnumberOfObjectives
- the number of objectivesnumberOfConstraints
- the number of constraintspublic java.lang.String getName()
Problem
public int getNumberOfVariables()
Problem
getNumberOfVariables
in interface Problem
public int getNumberOfObjectives()
Problem
getNumberOfObjectives
in interface Problem
public int getNumberOfConstraints()
Problem
getNumberOfConstraints
in interface Problem
public void close()
Problem
Copyright 2009-2024 David Hadka and other contributors. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage.