dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
ExpKnap.h
Go to the documentation of this file.
1 
12 #ifndef DIGNEA_KP_ExpKnap_HEURISTIC_H
13 #define DIGNEA_KP_ExpKnap_HEURISTIC_H
14 
15 #include <dignea/core/Heuristic.h>
16 #include <dignea/problems/KPNR.h>
17 
18 #include <nlohmann/json.hpp>
19 #include <vector>
20 
21 using json = nlohmann::json;
22 using namespace std;
28 class ExpKnap : public Heuristic<BoolFloatSolution> {
29  public:
30  ExpKnap();
31 
32  virtual ~ExpKnap() = default;
33 
34  void run() override;
35 
36  string getName() const { return "ExpKnap KP"; };
37 
38  string getID() const { return "ExpKnap"; }
39 
40  void setProblem(shared_ptr<KP> prob);
41 
42  void setProblem(KP *prob);
43 
44  Front<BoolFloatSolution> getResults() const override;
45 };
46 
47 #endif // DIGNEA_KP_ExpKnap_HEURISTIC_H
nlohmann::json json
Definition: MinKnap.h:85
ExpKnap Heuristic for the Knapsack Problem. Tries to insert each item in the knapsack while there is ...
Definition: ExpKnap.h:28
string getID() const
Returns the identificator of the algorithm, this is used in the to_json method. Must be implemented i...
Definition: ExpKnap.h:38
string getName() const
Returns the name of the algorithm, this is used in the to_json method. Must be implemented in the sub...
Definition: ExpKnap.h:36
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
Class representing a Knapsack Problem.
Definition: KP.h:28