MOEA Framework 2.12
API Specification

org.moeaframework.problem
Class AbstractProblem

java.lang.Object
  extended by org.moeaframework.problem.AbstractProblem
All Implemented Interfaces:
Problem
Direct Known Subclasses:
BBOBFunction, Belegundu, Binh, Binh2, Binh3, Binh4, CF1, CF10, CF2, CF3, CF4, CF5, CF6, CF7, CF8, CF9, DTLZ, Fonseca, Fonseca2, Jimenez, Kita, Kursawe, Laumanns, Lis, LZ, Murata, Obayashi, OKA1, OKA2, Osyczka, Osyczka2, Poloni, ProblemStub, Quagliarella, Rendon, Rendon2, Schaffer, Schaffer2, Srinivas, StackedProblem, Tamaki, Tanaka, UF1, UF10, UF11, UF12, UF2, UF3, UF4, UF5, UF6, UF7, UF8, UF9, Viennet, Viennet2, Viennet3, Viennet4, WFG, ZDT

public abstract class AbstractProblem
extends Object
implements Problem

Abstract class for a 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.


Field Summary
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 Summary
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.
 
Method Summary
 void close()
          Closes any underlying resources used by this problem.
protected  void finalize()
          Calls close() if this problem has not yet been closed prior to finalization.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.moeaframework.core.Problem
evaluate, newSolution
 

Field Detail

numberOfVariables

protected final int numberOfVariables
The number of variables defined by this problem.


numberOfObjectives

protected final int numberOfObjectives
The number of objectives defined by this problem.


numberOfConstraints

protected final int numberOfConstraints
The number of constraints defined by this problem.

Constructor Detail

AbstractProblem

public AbstractProblem(int numberOfVariables,
                       int numberOfObjectives)
Constructs an unconstrained abstract problem with the specified number of decision variables and objectives.

Parameters:
numberOfVariables - the number of decision variables
numberOfObjectives - the number of objectives

AbstractProblem

public AbstractProblem(int numberOfVariables,
                       int numberOfObjectives,
                       int numberOfConstraints)
Constructs an abstract problem with the specified number of decision variables, objectives and constraints.

Parameters:
numberOfVariables - the number of decision variables
numberOfObjectives - the number of objectives
numberOfConstraints - the number of constraints
Method Detail

getName

public String getName()
Description copied from interface: Problem
Returns the user-friendly name for this problem.

Specified by:
getName in interface Problem
Returns:
the user-friendly name for this problem

getNumberOfVariables

public int getNumberOfVariables()
Description copied from interface: Problem
Returns the number of decision variables defined by this problem.

Specified by:
getNumberOfVariables in interface Problem
Returns:
the number of decision variables defined by this problem

getNumberOfObjectives

public int getNumberOfObjectives()
Description copied from interface: Problem
Returns the number of objectives defined by this problem.

Specified by:
getNumberOfObjectives in interface Problem
Returns:
the number of objectives defined by this problem

getNumberOfConstraints

public int getNumberOfConstraints()
Description copied from interface: Problem
Returns the number of constraints defined by this problem.

Specified by:
getNumberOfConstraints in interface Problem
Returns:
the number of constraints defined by this problem

finalize

protected void finalize()
                 throws Throwable
Calls close() if this problem has not yet been closed prior to finalization.

Overrides:
finalize in class Object
Throws:
Throwable

close

public void close()
Description copied from interface: Problem
Closes any underlying resources used by this problem. Once closed, further invocations of any methods on this problem may throw exceptions.

Specified by:
close in interface Problem

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!