MOEA Framework 2.12
API Specification

Class Schaffer2

  extended by org.moeaframework.problem.AbstractProblem
      extended by org.moeaframework.problem.misc.Schaffer2
All Implemented Interfaces:
Problem, AnalyticalProblem

public class Schaffer2
extends AbstractProblem
implements AnalyticalProblem

The Schaffer (2) problem. The Schaffer (2) problem is univariate, with the optimum defined by 1 <= x <= 2 and 4 <= x <= 5.



  1. Schaffer, J. D. (1984). "Some Experiments in Machine Learning using Vector Evaluated Genetic Algorithms." Ph.D. Thesis, Vanderbilt University, Nashville, USA.
  2. Schaffer, J. D. (1985). "Multiple Objective Optimization with Vector Evaluated Genetic Algorithms." Genetic Algorithms and Their Applications: Proceedings of the First International Conference on Genetic Algorithms, pp. 93-100.
  3. Van Veldhuizen, D. A (1999). "Multiobjective Evolutionary Algorithms: Classifications, Analyses, and New Innovations." Air Force Institute of Technology, Ph.D. Thesis, Appendix B.

Field Summary
Fields inherited from class org.moeaframework.problem.AbstractProblem
numberOfConstraints, numberOfObjectives, numberOfVariables
Constructor Summary
          Constructs the Schaffer (2) problem.
Method Summary
 void evaluate(Solution solution)
          Evaluates the solution, updating the solution's objectives in place.
 Solution generate()
          Returns a randomly-generated solution using the analytical solution to this problem.
 Solution newSolution()
          Returns a new solution for this problem.
Methods inherited from class org.moeaframework.problem.AbstractProblem
close, finalize, getName, getNumberOfConstraints, getNumberOfObjectives, getNumberOfVariables
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
close, getName, getNumberOfConstraints, getNumberOfObjectives, getNumberOfVariables

Constructor Detail


public Schaffer2()
Constructs the Schaffer (2) problem.

Method Detail


public void evaluate(Solution solution)
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 interface Problem
solution - the solution to be evaluated


public Solution 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 may leave the actual value at a default or undefined state.

Specified by:
newSolution in interface Problem
a new solution for this problem


public Solution generate()
Description copied from interface: AnalyticalProblem
Returns a randomly-generated solution using the analytical solution to this problem. Note however that discontinuous Pareto surfaces may result in some solutions generated by this method being dominated by other generated solutions. It is therefore recommended using a NondominatedPopulation to removed dominated solutions prior to using the generated reference set.

The generated solutions should be spread uniformly across the entire Pareto frontier; however, this is a suggestion and is not a requirement of this interface.

Specified by:
generate in interface AnalyticalProblem
a randomly-generated Pareto optimal solution to this 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!