3 #ifndef DIGNEA_HEURISTIC_H
4 #define DIGNEA_HEURISTIC_H
8 #include <nlohmann/json.hpp>
25 virtual void run() = 0;
29 virtual string getID()
const = 0;
89 std::chrono::duration<double> diff = this->endTime - this->startTime;
90 this->elapsedTime = diff.count();
101 data[
"name"] = this->getName();
nlohmann::json json
Definition: MinKnap.h:85
Class to define an Abstract Evolutionary Algorithm. This is the base skeleton for future extensions.
Definition: AbstractEA.h:42
Front class which stores the final results of an EA execution.
Definition: Front.h:26
Base heuristic class. This is the skeleton for future heuristic implementations. Extends AbstractEA f...
Definition: Heuristic.h:19
virtual json to_json() const
Returns the JSON representation of the Heuristic.
Definition: Heuristic.h:99
virtual void updateEvolution(const int &checkpoint, vector< S > &)
Not implemented. Nothing really to do here.
Definition: Heuristic.h:79
virtual void createInitialPopulation()
Not implemented. Nothing really to do here.
Definition: Heuristic.h:61
virtual void run()=0
Main method of the EA. Runs the algorithm but must be implemented in the subclasses.
virtual void initProgress()
Not implemented. Nothing really to do here.
Definition: Heuristic.h:40
virtual string getID() const =0
Returns the identificator of the algorithm, this is used in the to_json method. Must be implemented i...
void finishProgress() override
Finishes the progress of the Heuristic by computing the elapsed time.
Definition: Heuristic.h:88
virtual void updateEvolution(vector< S > &)
Not implemented. Nothing really to do here.
Definition: Heuristic.h:73
bool isStoppingConditionReached() override
Always returns false. TODO: Refactor to inherit from Algorithm.
Definition: Heuristic.h:55
virtual Front< S > getResults() const =0
Returns a Front object with all the solutions of the evolutionary process. This method must be implem...
virtual string getName() const =0
Returns the name of the algorithm, this is used in the to_json method. Must be implemented in the sub...
virtual void evaluatePopulation(vector< S > &)
Not implemented. Nothing really to do here.
Definition: Heuristic.h:67
virtual void updateProgress()
Not implemented. Nothing really to do here.
Definition: Heuristic.h:46