-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndividual.hpp
48 lines (40 loc) · 1.48 KB
/
Individual.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef INDIVIDUAL_HPP_INCLUDED
#define INDIVIDUAL_HPP_INCLUDED
#include "Objectives.hpp"
using namespace std;
class Individual{
public:
Individual();
void InitializeIndividual(Benchmark *ObjBenchmark);
/**
Se obtiene el objeto objectives el cual consta de la información
de todas las funciones objetivo.
**/
/**
Get
**/
inline Objectives& getObjectives(){ return ObjObjectives; }
inline double getDistance(){return this->Distance;}
inline double getRank(){return this->Rank;}
inline int getNumberObjectives(){return this->NumberObjectives;}
inline int getDimension(){return this->Dimension;}
/**
Set
**/
inline void setRank(int Rank){ this->Rank = Rank;}
inline void setDistance(double Distance){this->Distance = Distance;}
void EvalIndividual();
void DecodeIndividual(vector<double> & Genotype);
vector<vector<bool>> DecisionVariables;
private:
Objectives ObjObjectives;
int Dimension, NumberObjectives, Rank, nbits;
double Distance;
double getBase10(vector<bool> &Individuo, double Min , double Max);
int BinarytoInt(vector<bool> &Individuo);
vector<vector<double>> Bounds;
void setRandom();
//Generar boleanos aleatorios con una distribución bernoulli
vector<bool>random_bool( double p = 0.5);
};
#endif // INDIVIDUAL_HPP_INCLUDED