-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype.h
40 lines (29 loc) · 1.01 KB
/
type.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
#define MAXCITY 31 /* max no of cities*/
typedef struct {
int* chrom; /* the chromosome */
double fitness;
int parent1;
int parent2;
} INDIVIDUAL;
typedef INDIVIDUAL *IPTR;
typedef struct {
IPTR op; /* arrays of individuals form an evolving population*/
IPTR np;
int lchrom; /* chromosome length */
int gen; /* current generation */
double sumFitness; /* statistics parameters for selection and tracking*/
double max; /* progress */
double avg;
double min;
double pCross; /* probability of Xover */
double pMut; /* probability of Mutation */
double randomseed;
double highestEverFitness;
int highestEverGen;
int highestEverIndex;
int maxi; /* index of best individual in current population*/
int mini; /* index of worst individual in current population*/
int maxGen; /* when to stop */
int popSize;/* population size */
char *ofile; /* output File name */
} POPULATION;