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