-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMA.h
More file actions
39 lines (33 loc) · 756 Bytes
/
MA.h
File metadata and controls
39 lines (33 loc) · 756 Bytes
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
#ifndef __MA_H__
#define __MA_H__
#include "SteinerTree.h"
struct ExtendedIndividual {
SteinerTree ind;
int dist;
};
class MA {
public:
MA(int N_, double pc_, double pm_, double finalTime_);
void run();
private:
//Parameters of MA
int N;//Population Size
double pc;//crossover probability
double pm;//mutation probability
double finalTime;//Seconds
//Basic procedures of MA
void initPopulation();
void initDI();
void selectParents();
void crossover();
void mutation();
void localSearch();
void replacement();
//Internal attributes of MA
vector< ExtendedIndividual * > population;
vector< ExtendedIndividual * > parents;
vector< ExtendedIndividual * > offspring;
double initialTime;
double DI;
};
#endif