5 #ifndef DIGNEA_CXFACTORY_H
6 #define DIGNEA_CXFACTORY_H
8 #include <dignea/core/Crossover.h>
21 map<CXType, function<unique_ptr<Crossover<S>>()>> factories;
25 factories[CXType::Uniform] = [] {
26 return make_unique<UniformCrossover<S>>();
28 factories[CXType::Order] = [] {
29 return make_unique<OrderCrossover<S>>();
39 unique_ptr<Crossover<S>>
create(
CXType type) {
return factories[type](); }
CXType
Types of Crossover Operators implemented in dignea.
Definition: CrossoverTypes.h:23
Crossover factory which allows the user to create Crossover operators easily.
Definition: CXFactory.h:19
unique_ptr< Crossover< S > > create(CXType type)
Creates a unique pointer to a Crossover Operator of the given type. Variants are available at CXType.
Definition: CXFactory.h:39