?? eval.c
字號(hào):
/* Routine for evaluating population members */# include <stdio.h># include <stdlib.h># include <math.h># include "global.h"# include "rand.h"/* Routine to evaluate objective function values and constraints for a population */void evaluate_pop (population *pop){ int i; for (i=0; i<popsize; i++) { evaluate_ind (&(pop->ind[i])); } return;}/* Routine to evaluate objective function values and constraints for an individual */void evaluate_ind (individual *ind){ int j; test_problem (ind->xreal, ind->obj, ind->constr); if (ncon==0) { ind->constr_violation = 0.0; } else { ind->constr_violation = 0.0; for (j=0; j<ncon; j++) { if (ind->constr[j]<0.0) { ind->constr_violation += ind->constr[j]; } } } return;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -