11 #ifndef DIGNEA_NSFACTORY_H
12 #define DIGNEA_NSFACTORY_H
14 #include <dignea/searches/NSFeatures.h>
15 #include <dignea/searches/NSPerformance.h>
16 #include <dignea/searches/NoveltySearch.h>
31 map<NSType, function<unique_ptr<NoveltySearch<S>>(
32 unique_ptr<Distance<float>> dist,
const float& thres,
33 const float& finalThresh,
const int k,
bool warmUp)>>
38 factories[NSType::Standard] =
39 [](unique_ptr<Distance<float>> dist,
const float& thres,
40 const float& finalThresh,
const int k,
bool warmUp) {
41 return make_unique<NoveltySearch<S>>(move(dist), thres,
44 factories[NSType::Features] =
45 [](unique_ptr<Distance<float>> dist,
const float& thres,
46 const float& finalThresh,
const int k,
bool warmUp) {
47 return make_unique<NSFeatures<S>>(move(dist), thres,
48 finalThresh, k, warmUp);
50 factories[NSType::Performance] =
51 [](unique_ptr<Distance<float>> dist,
const float& thres,
52 const float& finalThresh,
const int k,
bool warmUp) {
53 return make_unique<NSPerformance<S>>(move(dist), thres,
67 const float& finalThresh,
const int k,
69 return factories[type](move(dist), thres, finalThresh, k, warmUp);
NSType
Type of Novelty Search algorithms available in dignea at the moment.
Definition: NSTypes.h:23
Novelty Search factory which allows the user to create Novelty Search algorithms on the go.
Definition: NSFactory.h:29
unique_ptr< NoveltySearch< S > > create(NSType type, unique_ptr< Distance< float >> dist, const float &thres, const float &finalThresh, const int k, bool warmUp)
Creates a unique pointer to a Novelty Search algorithm of given type. Variants are available at NSTyp...
Definition: NSFactory.h:64