Class ProblemProvider
- Direct Known Subclasses:
BBOB2016Problems
,CDTLZProblemProvider
,ClassLoaderProblems
,PropertiesProblems
,RegisteredProblemProvider
,RotatedProblems
null
if the problem is not supported by the provider.
If the provider can supply the problem but an error occurred during instantiation, the provider may throw a
ProviderNotFoundException
along with the details causing the exception.
To provide a custom ProblemProvider
, 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.ProblemProvider
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 ProblemFactory.getProblem(String)
and
ProblemFactory.getReferenceSet(String)
methods.
As problems 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
-
Method Summary
Modifier and TypeMethodDescriptionReturns the problem names to appear in the diagnostic tool.getEpsilons
(String name) Returns the recommended or default ε values for the specified problem, ornull
if this provider does not support the problem or no defaults are provided.abstract Problem
getProblem
(String name) Returns the problem with the specified name, ornull
if this provider does not support the problem.abstract NondominatedPopulation
getReferenceSet
(String name) Returns the reference set for the specified problem, ornull
if this provider does not support the problem or no reference set is available.
-
Constructor Details
-
ProblemProvider
public ProblemProvider()Constructs a problem provider.
-
-
Method Details
-
getDiagnosticToolProblems
Returns the problem names to appear in the diagnostic tool. For best results, only include problems with two objectives and have a defined reference set.- Returns:
- the problem names to appear in the diagnostic tool
-
getProblem
Returns the problem with the specified name, ornull
if this provider does not support the problem.- Parameters:
name
- the problem name- Returns:
- the problem with the specified name, or
null
if this provider does not support the problem
-
getReferenceSet
Returns the reference set for the specified problem, ornull
if this provider does not support the problem or no reference set is available.- Parameters:
name
- the problem name- Returns:
- the reference set for the specified problem, or
null
if this provider does not support the problem or no reference set is available
-
getEpsilons
Returns the recommended or default ε values for the specified problem, ornull
if this provider does not support the problem or no defaults are provided.- Parameters:
name
- the problem name- Returns:
- the ε values for the specified problem, or
null
if this provider does not support the problem or no reference set is available
-