MOEA Framework 2.12
API Specification

org.moeaframework.core
Interface Algorithm

All Known Subinterfaces:
EpsilonBoxEvolutionaryAlgorithm, EvolutionaryAlgorithm
All Known Implementing Classes:
AbstractAlgorithm, AbstractEvolutionaryAlgorithm, AbstractPSOAlgorithm, AdaptiveTimeContinuation, Checkpoints, CMAES, DBEA, DifferentialEvolution, EpsilonMOEA, EpsilonProgressContinuation, EvolutionStrategy, GDE3, GeneticAlgorithm, IBEA, InstrumentedAlgorithm, JMetalAlgorithmAdapter, MOEAD, MSOPS, NSGAII, OMOPSO, PAES, PeriodicAction, PESA2, PISAAlgorithm, RandomSearch, RepeatedSingleObjective, RVEA, SMPSO, SMSEMOA, SPEA2, VEGA

public interface Algorithm

Interface for an optimization algorithm. An optimization algorithm operates by performing a series of optimization steps, though the amount of work performed by each step depends on the algorithm. For example, an algorithm may completely solve a problem in one step or may require hundreds of thousands of steps.


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()
          Returns a Serializable object representing the internal state of this algorithm.
 boolean isTerminated()
          Returns true if this algorithm is terminated; false otherwise.
 void setState(Object state)
          Sets the internal state of of this algorithm.
 void step()
          Performs one logical step of this algorithm.
 void terminate()
          Terminates this algorithm.
 

Method Detail

getProblem

Problem getProblem()
Returns the problem being solved by this algorithm.

Returns:
the problem being solved by this algorithm

getResult

NondominatedPopulation getResult()
Returns the current best-known result.

Returns:
the current best-known result

step

void step()
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 isTerminated() returns true.


evaluate

void evaluate(Solution solution)
Evaluates the specified solution for the problem being solved by this algorithm.

Parameters:
solution - the solution to be evaluated
See Also:
Problem.evaluate(Solution)

getNumberOfEvaluations

int getNumberOfEvaluations()
Returns the number of times the evaluate method was invoked. This is the primary measure of runtime for optimization algorithms.

Returns:
the number of times the evaluate method was invoked

isTerminated

boolean isTerminated()
Returns true if this algorithm is terminated; false otherwise.

Returns:
true if this algorithm is terminated; false otherwise
See Also:
terminate()

terminate

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


getState

Serializable getState()
                      throws NotSerializableException
Returns a Serializable object representing the internal state of this algorithm.

Returns:
a Serializable object representing the internal state of this algorithm
Throws:
NotSerializableException - if this algorithm does not support serialization
AlgorithmException - if this algorithm has not yet been initialized

setState

void setState(Object state)
              throws NotSerializableException
Sets the internal state of of this algorithm.

Parameters:
state - the internal state of this algorithm
Throws:
NotSerializableException - if this algorithm does not support serialization
AlgorithmException - if this algorithm has already been initialized

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!