12 #ifndef __DIGNEA_REPFACTORY_H__
13 #define __DIGNEA_REPFACTORY_H__
15 #include <dignea/core/Replacement.h>
16 #include <dignea/core/Solution.h>
20 #include <dignea/types/ReplacementTypes.h>
31 map<ReplacementTypes, function<unique_ptr<Replacement<S>>()>> factories;
35 factories[ReplacementTypes::Generational] = [] {
36 return make_unique<EGenerational<S>>();
38 factories[ReplacementTypes::FirstImprove] = [] {
39 return make_unique<FirstImprove<S>>();
41 factories[ReplacementTypes::ReplaceWorst] = [] {
42 return make_unique<ReplaceWorst<S>>();
51 unique_ptr<Replacement<S>>
create(ReplacementTypes type) {
52 return factories[type]();
Replacement Factory which allows the user to easily create Replacement Operators.
Definition: RepFactory.h:29
unique_ptr< Replacement< S > > create(ReplacementTypes type)
Creates a unique pointer to a Selection Operator of type.
Definition: RepFactory.h:51