-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathglobal.cpp
More file actions
22 lines (21 loc) · 1.12 KB
/
global.cpp
File metadata and controls
22 lines (21 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "defs.h"
// Global variables
population popold , popnew, popwrite;
int maxgen; // maximum number of generations
double *time_run; // data to be stored
int *n_cross_better, *n_cross_best; // data to be stored
int gen; // generation
// Data set
double **X_dataset; // dataset: inputs
int *d_dataset; // dataset: desired outputs
int lcrom; // size of the cromosome
int n_attrib; // number of atributes (dimension)
// Parameters
int tournament_size=3; // size of the pool for tournament selection
int max_gen=1; // maximum number of generations
int leng_local=100; // number of generations to perform local search
double imig_ls_ratio=0.7; // ratio between individuals generated by local search and by imigration (if=1, all ls; if=0; all imigrants)
int n_runs_max = 25; // runs of the GA
float p_cross=0.6; // crossover rate
int popsize = 100; // size of the population
int load_initsol; // load initial solutions from file (0:no; 1: yes)