dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
Sphere.h
Go to the documentation of this file.
1 
11 #ifndef DIGNEA_SPHERE_H
12 #define DIGNEA_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 Sphere : public Problem<FloatSolution> {
26  public:
28  Sphere() = default;
29 
30  ~Sphere() override = default;
31 
34  explicit Sphere(const int &numberOfVars);
35 
39  explicit Sphere(const Sphere *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 "Sphere"; }
59 
62  void evaluate(FloatSolution &solution) const override;
63 
65  bool evaluateConstraints(FloatSolution &solution) const override;
66 
69  FloatSolution createSolution() const override;
70 
73  FloatSolution createSolution(ParallelPRNG &engine) const override;
74 
77  void readData(const string &path) override;
78 };
79 
80 #endif // DIGNEA_SPHERE_H
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
Sphere Optimization function.
Definition: Sphere.h:25
float getUpperLimit(int i) const override
Get the upper limit of the ith dimension.
Definition: Sphere.cpp:47
string getName() const override
Get the name of the Problem.
Definition: Sphere.h:58
FloatSolution createSolution() const override
Creates a random solution for the Sphere problem.
Definition: Sphere.cpp:27
float getLowerLimit(int i) const override
Get the lower limit of the ith dimension.
Definition: Sphere.cpp:39
bool evaluateConstraints(FloatSolution &solution) const override
Not implemented here.
Definition: Sphere.cpp:68
Sphere()=default
Creates a default Sphere object.
void readData(const string &path) override
Not implemented here.
Definition: Sphere.cpp:63
void evaluate(FloatSolution &solution) const override
Evaluates a solution with the Sphere equation.
Definition: Sphere.cpp:14
int getOptimizationDirection(int i) const override
Get the optimization direction for each dimension of the problem.
Definition: Sphere.cpp:55