dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
ZDT.h
Go to the documentation of this file.
1 
12 #ifndef __DIGNEA_ZDT_H__
13 #define __DIGNEA_ZDT_H__
14 
15 #include <dignea/core/Problem.h>
16 #include <dignea/types/SolutionTypes.h>
17 #include <dignea/utilities/random/PseudoRandom.h>
18 
19 #include <iostream>
20 #include <vector>
21 
22 enum class ZDT_MODE { ZDT1, ZDT2, ZDT3, ZDT4, ZDT6 };
23 
28 class ZDT : public Problem<FloatSolution> {
29  public:
31  ZDT() = default;
32 
33  ~ZDT() override = default;
34 
37  explicit ZDT(ZDT_MODE mode, const int &numberOfVars);
38 
42  explicit ZDT(const ZDT *s);
43 
47  int getOptimizationDirection(int i) const override;
48 
52  float getUpperLimit(int i) const override;
53 
57  float getLowerLimit(int i) const override;
58 
61  string getName() const override { return "ZDT"; }
62 
65  void evaluate(FloatSolution &solution) const override;
66 
68  bool evaluateConstraints(FloatSolution &solution) const override;
69 
72  FloatSolution createSolution() const override;
73 
76  FloatSolution createSolution(ParallelPRNG &engine) const override;
77 
80  void readData(const string &path) override;
81 
82  private:
83  ZDT_MODE mode;
84 };
85 
86 #endif
Class to represent a Problem in the tool. It includes the basic information for a problem a few metho...
Definition: Problem.h:29
int numberOfVars
Definition: Problem.h:155
Class to represent a solution to the optimization problems in the tool.
Definition: Solution.h:25
Class to represent the family of ZDT functions.
Definition: ZDT.h:28
FloatSolution createSolution() const override
Creates a random solution for the ZDT problem.
Definition: ZDT.cpp:40
int getOptimizationDirection(int i) const override
Get the optimization direction for each dimension of the problem.
Definition: ZDT.cpp:68
float getUpperLimit(int i) const override
Get the upper limit of the ith dimension.
Definition: ZDT.cpp:60
bool evaluateConstraints(FloatSolution &solution) const override
Not implemented here.
Definition: ZDT.cpp:81
void readData(const string &path) override
Not implemented here.
Definition: ZDT.cpp:76
string getName() const override
Get the name of the Problem.
Definition: ZDT.h:61
ZDT()=default
Creates a default ZDT object.
void evaluate(FloatSolution &solution) const override
Evaluates a solution with the ZDT equation.
Definition: ZDT.cpp:22
float getLowerLimit(int i) const override
Get the lower limit of the ith dimension.
Definition: ZDT.cpp:52