?? realinit.h
字號:
/*This is the file which initializes the population*/void realinit(population *pop_ptr);void realinit(population *pop_ptr){ int i,j,r,d2; float d,d1; for (i = 0 ; i < popsize ; i++) { for (j = 0; j < nvar; j++) { d = randomperc(); d1 = 2*d - 1; /*if limits are not specified then generates any number between zero and infinity*/ if(ans != 1) { pop_ptr->ind[i].xreal[j] = 1/d1 ; } /*if limits are specified it generates the value in range of minimum and maximum value of the variable*/ else { pop_ptr->ind[i].xreal[j] = d*(lim_r[j][1] - lim_r[j][0])+lim_r[j][0]; } } /* pop_ptr->ind_ptr = &(pop_ptr->ind[i+1]); */ } /*pop_ptr->ind_ptr = &(pop_ptr->ind[0]); */ return;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -