|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.moeaframework.core.spi.AlgorithmProvider
public abstract class AlgorithmProvider
Defines an SPI for algorithms. Algorithms are identified by a unique name and
may be given optional Properties. The methods of the provider must
return null if the algorithm is not supported by the provider.
If the provider can supply the algorithm but an error occurred during
instantiation, the provider may throw a ProviderNotFoundException
along with the details causing the exception.
To provide a custom AlgorithmProvider, first extend this class and
implement the abstract method. Next, build a JAR file containing the custom
provider. Within the JAR file, create the file
META-INF/services/org.moeaframework.algorithm.AlgorithmProvider
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
algorithms(s) are now accessible via the
AlgorithmFactory.getAlgorithm(java.lang.String, java.util.Properties, org.moeaframework.core.Problem) methods.
As algorithm names are often used in file names, it is best to avoid
characters which are not compatible with the file system. It is suggested
that names match the following regular expression:
^[a-zA-Z0-9()\-,]+$.
| Constructor Summary | |
|---|---|
AlgorithmProvider()
Constructs an algorithm provider. |
|
| Method Summary | |
|---|---|
abstract Algorithm |
getAlgorithm(String name,
Properties properties,
Problem problem)
Returns the algorithm with the specified name, or null if this
provider does not support the algorithm. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AlgorithmProvider()
| Method Detail |
|---|
public abstract Algorithm getAlgorithm(String name,
Properties properties,
Problem problem)
null if this
provider does not support the algorithm. An optional set of properties
may be provided to further define the algorithm; however, the provider is
expected to supply default properties if none are provided.
name - the algorithm nameproperties - optional properties for the algorithmproblem - the problem
null if this
provider does not support the algorithm
|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||