MOEA Framework 2.5
API Specification

org.moeaframework.core.spi
Class OperatorFactory

java.lang.Object
  extended by org.moeaframework.core.spi.OperatorFactory

public class OperatorFactory
extends Object

Factory for creating operator instances. The table below shows the supported operators. The name and properties columns show the values accepted by getVariation(String, Properties, Problem).

Operator Type Name Properties
SBX Real sbx sbx.rate, sbx.distributionIndex
PM Real pm pm.rate, pm.distributionIndex
UM Real um um.rate
DifferentialEvolution Real de de.crossoverRate, de.stepSize
PCX Real pcx pcx.parents, pcx.offspring, pcx.eta, pcx.zeta
SPX Real spx spx.parents, spx.offspring, spx.epsilon
UNDX Real undx undx.parents, undx.offspring, undx.eta, undx.zeta
AdaptiveMetropolis Real am am.parents, am.offspring, am.coefficient
HUX Binary hux hux.rate
BitFlip Binary bf bf.rate
PMX Permutation pmx pmx.rate
Insertion Permutation insertion insertion.rate
Swap Permutation swap swap.rate
GrammarCrossover Grammar gx gx.rate
GrammarMutation Grammar gm gm.rate
SubtreeCrossover Program bx bx.rate
PointMutation Program ptm ptm.rate
OnePointCrossover Any 1x 1x.rate
TwoPointCrossover Any 2x 2x.rate
UniformCrossover Any ux ux.rate

Operators can be combined by joining the two operator names with the plus sign, such as "sbx+pm". Not all operators can be joined this way. See CompoundVariation for the restrictions.

This class is thread safe.


Constructor Summary
OperatorFactory()
          Constructs a new operator factory.
 
Method Summary
 String getDefaultMutation(Problem problem)
          Returns the name of the default mutation operator for the given problem.
 String getDefaultVariation(Problem problem)
          Returns the name of the default variation operator (e.g., crossover with mutation) for the given problem.
static OperatorFactory getInstance()
          Returns the default operator factory.
 Variation getVariation(String name, Properties properties, Problem problem)
          Equivalent to calling getVariation(String, TypedProperties, Problem).
 Variation getVariation(String name, TypedProperties properties, Problem problem)
          Returns an instance of the variation operator with the specified name.
static void setInstance(OperatorFactory instance)
          Sets the default operator factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperatorFactory

public OperatorFactory()
Constructs a new operator factory.

Method Detail

getInstance

public static OperatorFactory getInstance()
Returns the default operator factory.

Returns:
the default operator factory

setInstance

public static void setInstance(OperatorFactory instance)
Sets the default operator factory.

Parameters:
instance - the default operator factory

getDefaultMutation

public String getDefaultMutation(Problem problem)
Returns the name of the default mutation operator for the given problem. Mixed types are currently not supported.

Parameters:
problem - the problem
Returns:
the name of the default mutation operator for the given problem
Throws:
ProviderNotFoundException - if no default mutation operator could be determined

getDefaultVariation

public String getDefaultVariation(Problem problem)
Returns the name of the default variation operator (e.g., crossover with mutation) for the given problem. Mixed types are currently not supported.

Parameters:
problem - the problem
Returns:
the name of the default variation operator for the given problem
Throws:
ProviderNotFoundException - if no default variation operator could be determined

getVariation

public Variation getVariation(String name,
                              Properties properties,
                              Problem problem)
Equivalent to calling getVariation(String, TypedProperties, Problem).

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
Throws:
ProviderNotFoundException - if no provider for the algorithm is available

getVariation

public Variation getVariation(String name,
                              TypedProperties properties,
                              Problem problem)
Returns an instance of the variation operator with the specified name. This method must throw an ProviderNotFoundException if no suitable operator is found. If name is null, the factory should return a default variation operator appropriate for the problem.

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
Throws:
ProviderNotFoundException - if no provider for the algorithm is available

MOEA Framework 2.5
API Specification

Copyright 2009-2015 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Hosted by Get MOEA Framework at SourceForge.net. Fast, secure and Free Open Source software downloads