MOEA Framework 2.12
API Specification

org.moeaframework.core.spi
Class ProblemFactory

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

public class ProblemFactory
extends Object

Factory for creating optimization problem instances and their corresponding reference sets, if known. Problems are referenced by name. For example, getProblem("DTLZ2_2") will create an instance of the 2-objective DTLZ2 problem. See ProblemProvider for details on adding new providers.

Obligatory Link

This class is thread safe.


Constructor Summary
ProblemFactory()
          Constructs a new problem factory.
 
Method Summary
 void addProvider(ProblemProvider provider)
          Adds a problem provider to this problem factory.
static ProblemFactory getInstance()
          Returns the default problem factory.
 Problem getProblem(String name)
          Searches through all discovered ProblemProvider instances, returning an instance of the problem with the registered name.
 NondominatedPopulation getReferenceSet(String name)
          Searches through all discovered ProblemProvider instances, returning the reference set of the problem with the registered name.
static void setInstance(ProblemFactory instance)
          Sets the default problem factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProblemFactory

public ProblemFactory()
Constructs a new problem factory.

Method Detail

getInstance

public static ProblemFactory getInstance()
Returns the default problem factory.

Returns:
the default problem factory

setInstance

public static void setInstance(ProblemFactory instance)
Sets the default problem factory.

Parameters:
instance - the default problem factory

addProvider

public void addProvider(ProblemProvider provider)
Adds a problem provider to this problem factory. Subsequent calls to getProblem(String) or getReferenceSet(String) will search the given provider for a match.

Parameters:
provider - the new problem provider

getProblem

public Problem getProblem(String name)
Searches through all discovered ProblemProvider instances, returning an instance of the problem with the registered name. This method must throw an ProviderNotFoundException if no matching problem is found.

Parameters:
name - the name identifying the problem
Returns:
an instance of the problem with the registered name
Throws:
ProviderNotFoundException - if no provider for the problem is available

getReferenceSet

public NondominatedPopulation getReferenceSet(String name)
Searches through all discovered ProblemProvider instances, returning the reference set of the problem with the registered name. Returns null if no reference set is available for the specified problem.

Parameters:
name - the name identifying the problem
Returns:
the reference set of the problem with the registered name; or null if no reference set is available

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!