5 #ifndef DIGNEA_MUTFACTORY_H
6 #define DIGNEA_MUTFACTORY_H
8 #include <dignea/core/Mutation.h>
9 #include <dignea/core/Problem.h>
10 #include <dignea/core/Solution.h>
25 map<MutType, function<unique_ptr<Mutation<S>>()>> factories;
29 factories[MutType::UniformAll] = [] {
30 return make_unique<UniformAllMutation<S>>();
32 factories[MutType::UniformOne] = [] {
33 return make_unique<UniformOneMutation<S>>();
35 factories[MutType::SwapMutation] = [] {
36 return make_unique<SwapMutation<S>>();
45 unique_ptr<Mutation<S>>
create(
MutType type) {
return factories[type](); }
MutType
Type of Mutation Operators implemented in dignea.
Definition: MutationTypes.h:22
Mutation factory which allows the user to create Mutation Operators easily.
Definition: MutFactory.h:23
unique_ptr< Mutation< S > > create(MutType type)
Creates a unique pointer to a Mutation Operator of type.
Definition: MutFactory.h:45