5 #ifndef DIGNEA_NSPERFORMANCE_H
6 #define DIGNEA_NSPERFORMANCE_H
8 #include <dignea/distances/Distance.h>
10 #include <dignea/searches/NSFeatures.h>
15 #include <nlohmann/json.hpp>
35 const float &threshold = 2000,
36 const float &finalThresh = 2000,
const int &k = 15);
40 virtual json to_json()
override;
43 virtual vector<Descriptor> beforeRun(
const vector<S> &population)
override;
45 virtual vector<Descriptor> beforeCmpFinals(
46 const vector<S> &population)
override;
48 virtual void insertFinal(
const S &solution);
61 const float &threshold,
62 const float &finalThresh,
const int &k)
75 vector<Descriptor> combinedPop;
76 combinedPop.reserve(population.size() + this->noveltyArchive.size());
77 for (
const S &solution : population) {
78 combinedPop.push_back(solution.getAvgPortFitness());
80 for (
const S &solution : this->noveltyArchive) {
81 combinedPop.push_back(solution.getAvgPortFitness());
91 const vector<S> &population) {
92 vector<Descriptor> descriptors;
93 descriptors.reserve(population.size());
94 for (
const S &solution : population) {
95 descriptors.push_back(solution.getAvgPortFitness());
107 template <
typename S>
109 this->finalSs.push_back(solution);
110 this->finalSsDesc.push_back(solution.getAvgPortFitness());
119 template <
typename S>
122 data[
"name"] =
"NSPerformance";
nlohmann::json json
Definition: MinKnap.h:85
Class to represent the Novelty Search Algorithm.
Definition: NoveltySearch.h:50