dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
DoubleSphere.h
Go to the documentation of this file.
1 
11 #ifndef DIGNEA_DOUBLE_SPHERE_H
12 #define DIGNEA_DOUBLE_SPHERE_H
13 
14 #include <dignea/core/Problem.h>
15 #include <dignea/types/SolutionTypes.h>
16 #include <dignea/utilities/random/PseudoRandom.h>
17 
18 #include <iostream>
19 #include <vector>
20 
25 class DoubleSphere : public Problem<FloatSolution> {
26  public:
28  DoubleSphere() = default;
29 
30  ~DoubleSphere() override = default;
31 
34  explicit DoubleSphere(const int &numberOfVars);
35 
39  explicit DoubleSphere(const DoubleSphere *s);
40 
44  int getOptimizationDirection(int i) const override;
45 
49  float getUpperLimit(int i) const override;
50 
54  float getLowerLimit(int i) const override;
55 
58  string getName() const override { return "DoubleSphere"; }
59 
62  void evaluate(FloatSolution &solution) const override;
63 
65  bool evaluateConstraints(FloatSolution &solution) const override;
66 
69  FloatSolution createSolution() const override;
70 
74  FloatSolution createSolution(ParallelPRNG &engine) const override;
75 
78  void readData(const string &path) override;
79 };
80 
81 #endif // DIGNEA_SPHERE_H
Double Sphere Optimization function.
Definition: DoubleSphere.h:25
void evaluate(FloatSolution &solution) const override
Evaluates a solution with the DoubleSphere equation.
Definition: DoubleSphere.cpp:21
float getUpperLimit(int i) const override
Get the upper limit of the ith dimension.
Definition: DoubleSphere.cpp:56
DoubleSphere()=default
Creates a default DoubleSphere object.
bool evaluateConstraints(FloatSolution &solution) const override
Not implemented here.
Definition: DoubleSphere.cpp:79
int getOptimizationDirection(int i) const override
Get the optimization direction for each dimension of the problem.
Definition: DoubleSphere.cpp:65
float getLowerLimit(int i) const override
Get the lower limit of the ith dimension.
Definition: DoubleSphere.cpp:47
void readData(const string &path) override
Not implemented here.
Definition: DoubleSphere.cpp:74
FloatSolution createSolution() const override
Creates a random solution for the DoubleSphere problem.
Definition: DoubleSphere.cpp:35
string getName() const override
Get the name of the Problem.
Definition: DoubleSphere.h:58
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