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