-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyutils.h
executable file
·49 lines (39 loc) · 1.02 KB
/
pyutils.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
#include <string>
#include <sstream>
#include <vector>
#include <moeo>
using namespace std;
bool py_minimizing (int );
bool py_maximizing (int );
int py_nObjectives ();
double py_minimalBounds(int );
double py_maximalBounds(int );
int py_noParams ();
int py_init(string ,string ,string );
void py_report(string,string);
int py_fin();
// the moeoObjectiveVectorTraits : minimizing 2 objectives
class OVT : public moeoObjectiveVectorTraits
{
public:
static bool minimizing (int index){
return true;
}
static bool maximizing (int index){
return false;
}
static unsigned int nObjectives (){
int out = py_nObjectives();
return out;
}
};
// objective vector of real values
typedef moeoRealObjectiveVector < OVT > EvolveObjectiveVector;
// multi-objective evolving object for the Evolve problem
class Evolve : public moeoRealVector < EvolveObjectiveVector >
{
public:
Evolve() : moeoRealVector < EvolveObjectiveVector > (1)
{}
};
void py_popeval (eoPop<Evolve> & offspring);