dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
BPPInstance.h
Go to the documentation of this file.
1 
12 #ifndef DIGNEA_BPPINSTANCE_H
13 #define DIGNEA_BPPINSTANCE_H
14 
16 
28 class BPPInstance : public AbstractInstance<int, int> {
29  public:
30  BPPInstance();
31 
32  virtual ~BPPInstance() = default;
33 
34  explicit BPPInstance(const int &nVars, const int &nObjs = 1);
35 
36  BPPInstance(const BPPInstance &solution);
37 
38  explicit BPPInstance(const BPPInstance *solution);
39 
40  BPPInstance(unique_ptr<BPPInstance> &ptr) = delete;
41 
42  BPPInstance &operator=(const BPPInstance &copy);
43 
44  bool operator==(const BPPInstance &other) const;
45 
47  vector<float> getFeatures() const override;
48 
49  void setVariables(const vector<int> &vars) override;
50 
51  json to_json() const override;
52 
53  virtual void to_instance(std::ostream &os) const;
54 
55  inline int getCapacity() const { return this->capacity; }
56 
57  inline void setCapacity(int q) { this->capacity = q; }
58 
59  protected:
60  int capacity;
61 };
62 
63 #endif // DIGNEA_BPPINSTANCE_H
Solution for a Instance Generation Problem used in the EIG. This is a solution for AbstractDomain.
Definition: AbstractInstance.h:30
Instance Bin-Packing Problem Solution. Class which represents the solution for the Instance Bin-Packi...
Definition: BPPInstance.h:28
bool operator==(const BPPInstance &other) const
Compares whether two solutions are equal.
Definition: BPPInstance.cpp:76
virtual void to_instance(std::ostream &os) const
Generates a BPPInstance file with .bpp extension from the instance information.
Definition: BPPInstance.cpp:155
vector< float > getFeatures() const override
Get the features.
Definition: BPPInstance.cpp:100
void setVariables(const vector< int > &vars) override
Sets the variables of the solution. Expected to be twice of number of vars since it stores the pairs ...
Definition: BPPInstance.cpp:86
json to_json() const override
Creates a JSON object with the information of the BPPInstance.
Definition: BPPInstance.cpp:113
BPPInstance & operator=(const BPPInstance &copy)
Copies a solution using the assignment operator.
Definition: BPPInstance.cpp:45
int nVars
Definition: Solution.h:194
int nObjs
Definition: Solution.h:195