MOEA Framework 2.12
API Specification

org.moeaframework.core.spi
Class OperatorProvider

java.lang.Object
  extended by org.moeaframework.core.spi.OperatorProvider
Direct Known Subclasses:
StandardOperators

public abstract class OperatorProvider
extends Object

Defines an SPI for initializing different operators. Operators are identified by a unique name. The methods of the provider must return null if the operator is not supported by the provider.

If the provider can supply the operator but an error occurred during instantiation, the provider may throw a ProviderNotFoundException along with the details causing the exception.

To provide a custom OperatorProvider, first extend this class and implement the two abstract methods. Next, build a JAR file containing the custom provider. Within the JAR file, create the file META-INF/services/org.moeaframework.core.spi.OperatorProvider containing on a single line the class name of the custom provider. Lastly, add this JAR file to the classpath. Once these steps are completed, the problem(s) are now accessible via the methods in this class.


Constructor Summary
OperatorProvider()
          Constructs an operator provider.
 
Method Summary
abstract  String getMutationHint(Problem problem)
          Returns the name of the suggested mutation operator for the given problem.
abstract  Variation getVariation(String name, Properties properties, Problem problem)
          Returns an instance of the variation operator with the specified name.
abstract  String getVariationHint(Problem problem)
          Returns the name of the suggested variation operator for the given problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperatorProvider

public OperatorProvider()
Constructs an operator provider.

Method Detail

getMutationHint

public abstract String getMutationHint(Problem problem)
Returns the name of the suggested mutation operator for the given problem. Mixed types are currently not supported. Returns null if no mutation operators support the given problem.

Parameters:
problem - the problem
Returns:
the name of the suggested mutation operator for the given problem

getVariationHint

public abstract String getVariationHint(Problem problem)
Returns the name of the suggested variation operator for the given problem. Mixed types are currently not supported. Returns null if no variation operators support the given problem.

Parameters:
problem - the problem
Returns:
the name of the suggested variation operator for the given problem

getVariation

public abstract Variation getVariation(String name,
                                       Properties properties,
                                       Problem problem)
Returns an instance of the variation operator with the specified name. This method must return null if no suitable operator is found.

Parameters:
name - the name identifying the variation operator
properties - the implementation-specific properties
problem - the problem to be solved
Returns:
an instance of the variation operator with the specified name

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!