Package org.moeaframework.core.spi
Class RegisteredAlgorithmProvider
java.lang.Object
org.moeaframework.core.spi.AlgorithmProvider
org.moeaframework.core.spi.RegisteredAlgorithmProvider
- Direct Known Subclasses:
DefaultAlgorithms
Algorithm provider that lets callers register algorithms by name.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAlgorithm
(String name, TypedProperties properties, Problem problem) Returns the algorithm with the specified name, ornull
if this provider does not support the algorithm.Returns the algorithms names to appear in the diagnostic tool.protected final void
register
(BiFunction<TypedProperties, Problem, Algorithm> constructor, String... names) Registers a new algorithm with this provider.protected final void
Registers the given algorithm to appear in the diagnostic tool.protected final void
Registers all of the given algorithms to appear in the diagnostic tool.
-
Constructor Details
-
RegisteredAlgorithmProvider
public RegisteredAlgorithmProvider()Creates a new, empty problem provider.
-
-
Method Details
-
getDiagnosticToolAlgorithms
Description copied from class:AlgorithmProvider
Returns the algorithms names to appear in the diagnostic tool. If there are multiple aliases for the same algorithm, provide only the canonical name.- Overrides:
getDiagnosticToolAlgorithms
in classAlgorithmProvider
- Returns:
- the algorithm names
-
registerDiagnosticToolAlgorithm
Registers the given algorithm to appear in the diagnostic tool.- Parameters:
name
- the algorithm name
-
registerDiagnosticToolAlgorithms
Registers all of the given algorithms to appear in the diagnostic tool.- Parameters:
names
- the algorithm names
-
register
protected final void register(BiFunction<TypedProperties, Problem, Algorithm> constructor, String... names) Registers a new algorithm with this provider.- Parameters:
constructor
- the function that creates a new instance of the algorithmnames
- the name or names for this algorithm
-
getAlgorithm
Description copied from class:AlgorithmProvider
Returns the algorithm with the specified name, ornull
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.- Specified by:
getAlgorithm
in classAlgorithmProvider
- Parameters:
name
- the algorithm nameproperties
- optional properties for the algorithmproblem
- the problem- Returns:
- the algorithm with the specified name, or
null
if this provider does not support the algorithm
-