-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMOEADInd.h
69 lines (51 loc) · 1.44 KB
/
MOEADInd.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef __INDIVIDUAL_H_
#define __INDIVIDUAL_H_
#ifndef __GLOBAL_H_
#include "Global.h"
#endif
//#include "testfunc.h"
//#include "problem.h"
/** Possible relations between points in multiple objective space */
//enum TCompare {_Pareto_Dominating, _Pareto_Dominated, _Pareto_Nondominated, _Pareto_Equal};
class CIndividual{
private :
double evaluate_length( const int& n ) ;
double evaluate_smoothness( const int& n ) ;
double evaluate_security(const int& n) ;
public:
CIndividual();
virtual ~CIndividual();
vector <int> x_var ;
vector <double> y_obj ;
int rank;
int count;
void rnd_init();
void obj_eval( const int& i );
void show_objective();
void show_variable();
bool check( CIndividual const* ind, const int& n ) ;
bool operator<(const CIndividual &ind2);
bool operator<<(const CIndividual &ind2);
bool operator==(const CIndividual &ind2);
void operator=(const CIndividual &ind2);
/** Compares two points in multiple objective space
*
* Returns _Dominated if this is dominated
* Returns _Dominating if this is dominating
* It may also return _Nondominated or _Equal */
TCompare Compare(CIndividual& ind2);
};
// defining subproblem
class TSOP
{
public:
TSOP();
virtual ~TSOP();
//void show();
CIndividual indiv;
vector <double> namda;
vector <int> table; // the vector for the indexes of neighboring subproblems
vector <int> array;
void operator=(const TSOP&sub2);
};
#endif