-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindividual.hpp
executable file
·36 lines (31 loc) · 1000 Bytes
/
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
#ifndef _INDIVIDUAL_H_
#define _INDIVIDUAL_H_
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
class Individual {
private:
std::vector<double> currentPosition;
std::vector<double> bestPosition;
std::vector<double> velocity;
double fitness;
double bestFitness;
public:
Individual(std::vector<double> position, std::vector<double> velocity, int dimension);
~Individual();
std::vector<double> getCurrentPosition();
std::vector<double> getFullBestPosition();
std::vector<double> getVelocityVector();
double getBestPosition(int pos);
double getVelocity(int pos);
double getFitness();
double getBestFitness();
double getPosition(int pos);
void setCurrentPosition(std::vector<double> currentPosition);
void setBestPosition(std::vector<double> bestPosition);
void setVelocity(std::vector<double> velocity);
void setFitness(double fitness);
void setBestFitness(double bestFitness);
};
#endif