public class OperatorFactory extends AbstractFactory<OperatorProvider>
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 and Description |
---|
OperatorFactory()
Constructs a new operator factory.
|
Modifier and Type | Method and Description |
---|---|
static OperatorFactory |
getInstance()
Returns the default operator factory.
|
Mutation |
getMutation(Problem problem)
Returns the suggested mutation operator for the given problem.
|
Mutation |
getMutation(java.lang.String name,
TypedProperties properties,
Problem problem)
Returns the suggested mutation operator for the given problem.
|
Variation |
getVariation(Problem problem)
Returns the suggested variation operator for the given problem.
|
Variation |
getVariation(java.lang.String name,
Problem problem)
Returns the named variation operator using default settings.
|
Variation |
getVariation(java.lang.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.
|
addProvider, hasProvider, iterator
public static OperatorFactory getInstance()
public static void setInstance(OperatorFactory instance)
instance
- the default operator factorypublic Mutation getMutation(Problem problem)
problem
- the problempublic Mutation getMutation(java.lang.String name, TypedProperties properties, Problem problem)
name
is
null
, this will attempt to return a mutation operator appropriate for the
problem.name
- the name of the mutation operatorproperties
- the implementation-specific propertiesproblem
- the problempublic Variation getVariation(Problem problem)
problem
- the problem to be solvedpublic Variation getVariation(java.lang.String name, Problem problem)
name
- the name identifying the variation operatorproblem
- the problem to be solvedpublic Variation getVariation(java.lang.String name, TypedProperties properties, Problem problem)
ProviderNotFoundException
if no
suitable operator is found. If name
is null, the factory should
return a default variation operator appropriate for the problem.name
- the name of the variation operatorproperties
- the implementation-specific propertiesproblem
- the problem to be solvedProviderNotFoundException
- if no provider for the algorithm is
availableCopyright 2009-2024 David Hadka and other contributors. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage.