MOEA Framework 2.12
API Specification

org.moeaframework.algorithm.jmetal
Class JMetalAlgorithmAdapter

java.lang.Object
  extended by org.moeaframework.algorithm.jmetal.JMetalAlgorithmAdapter
All Implemented Interfaces:
Algorithm

public class JMetalAlgorithmAdapter
extends Object
implements Algorithm

Adapter for JMetal algorithms. This allows JMetal algorithms to be used within the MOEA Framework as an Algorithm.


Constructor Summary
JMetalAlgorithmAdapter(jmetal.core.Algorithm algorithm, JMetalProblemAdapter problem)
          Constructs an adapter for the specified JMetal algorithm.
 
Method Summary
 void evaluate(Solution solution)
          Evaluates the specified solution for the problem being solved by this algorithm.
 int getNumberOfEvaluations()
          Returns the number of times the evaluate method was invoked.
 Problem getProblem()
          Returns the problem being solved by this algorithm.
 NondominatedPopulation getResult()
          Returns the current best-known result.
 Serializable getState()
          Throws NotSerializableException since JMetal algorithms are currently not serializable.
 boolean isTerminated()
          Returns true if this algorithm is terminated; false otherwise.
 void setState(Object state)
          Throws NotSerializableException since JMetal algorithms are currently not serializable.
 void step()
          Performs one logical step of this algorithm.
 void terminate()
          Terminates this algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMetalAlgorithmAdapter

public JMetalAlgorithmAdapter(jmetal.core.Algorithm algorithm,
                              JMetalProblemAdapter problem)
Constructs an adapter for the specified JMetal algorithm.

Parameters:
algorithm - the JMetal algorithm
Method Detail

evaluate

public void evaluate(Solution solution)
Description copied from interface: Algorithm
Evaluates the specified solution for the problem being solved by this algorithm.

Specified by:
evaluate in interface Algorithm
Parameters:
solution - the solution to be evaluated
See Also:
Problem.evaluate(Solution)

getNumberOfEvaluations

public int getNumberOfEvaluations()
Description copied from interface: Algorithm
Returns the number of times the evaluate method was invoked. This is the primary measure of runtime for optimization algorithms.

Specified by:
getNumberOfEvaluations in interface Algorithm
Returns:
the number of times the evaluate method was invoked

getProblem

public Problem getProblem()
Description copied from interface: Algorithm
Returns the problem being solved by this algorithm.

Specified by:
getProblem in interface Algorithm
Returns:
the problem being solved by this algorithm

getResult

public NondominatedPopulation getResult()
Description copied from interface: Algorithm
Returns the current best-known result.

Specified by:
getResult in interface Algorithm
Returns:
the current best-known result

step

public void step()
Description copied from interface: Algorithm
Performs one logical step of this algorithm. The amount of work performed depends on the implementation. One invocation of this method may produce one or many trial solutions.

This method should not be invoked when Algorithm.isTerminated() returns true.

Specified by:
step in interface Algorithm

isTerminated

public boolean isTerminated()
Description copied from interface: Algorithm
Returns true if this algorithm is terminated; false otherwise.

Specified by:
isTerminated in interface Algorithm
Returns:
true if this algorithm is terminated; false otherwise
See Also:
Algorithm.terminate()

terminate

public void terminate()
Description copied from interface: Algorithm
Terminates this algorithm. Implementations should use this method to free any underlying resources; however, the Algorithm.getResult() and Algorithm.getNumberOfEvaluations() methods are still required to work after termination.

Specified by:
terminate in interface Algorithm

getState

public Serializable getState()
                      throws NotSerializableException
Throws NotSerializableException since JMetal algorithms are currently not serializable.

Specified by:
getState in interface Algorithm
Returns:
a Serializable object representing the internal state of this algorithm
Throws:
NotSerializableException - if this algorithm does not support serialization

setState

public void setState(Object state)
              throws NotSerializableException
Throws NotSerializableException since JMetal algorithms are currently not serializable.

Specified by:
setState in interface Algorithm
Parameters:
state - the internal state of this algorithm
Throws:
NotSerializableException - if this algorithm does not support serialization

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!