/** Author: Dr. Yoshito Hirata Institute of Industrial Science, The University of Tokyo, 4-6-1 Komaba, Meguro-ku, Tokyo 153-8505, JAPAN email: yoshito at sat dot t dot u-tokyo dot ac dot jp, where "at" and "dot" should be replaced appropriately. This is a program used for analyzing clinical data of intermittent androgen suppression for prostate cancer in the following paper: Y. Hirata, N. Bruchovsky, and K. Aihara, ``Development of a mathematical model that predicts the outcome of hormone therapy for prostate cancer,'' Journal of Theoretical Biology 264, 517 (2010). Although I retain the copyright, you may redistribute and/or modify this program personally, academically, clinically, and/or commercially as far as this header is kept and you contribute for human welfare. I and/or my co-authors do not take any responsibility for damages, health problems, lives, financial problems, and any other circumstances this program may cause. Shortly, please use this program with your own responsibility. Clinical datasets are available from http://www.nicholasbruchovsky.com/clinicalResearch.html. **/ /*************************************************************** ** ** ** D I F F E R E N T I A L E V O L U T I O N ** ** ** ** Program: de.c ** ** Version: 3.6 ** ** ** ** Authors: Dr. Rainer Storn ** ** c/o ICSI, 1947 Center Street, Suite 600 ** ** Berkeley, CA 94707 ** ** Tel.: 510-642-4274 (extension 192) ** ** Fax.: 510-643-7684 ** ** E-mail: storn@icsi.berkeley.edu ** ** WWW: http://http.icsi.berkeley.edu/~storn/ ** ** on leave from ** ** Siemens AG, ZFE T SN 2, Otto-Hahn Ring 6 ** ** D-81739 Muenchen, Germany ** ** Tel: 636-40502 ** ** Fax: 636-44577 ** ** E-mail: rainer.storn@zfe.siemens.de ** ** ** ** Kenneth Price ** ** 836 Owl Circle ** ** Vacaville, CA 95687 ** ** E-mail: kprice@solano.community.net ** ** ** ** This program implements some variants of Differential ** ** Evolution (DE) as described in part in the techreport ** ** tr-95-012.ps of ICSI. You can get this report either via ** ** ftp.icsi.berkeley.edu/pub/techreports/1995/tr-95-012.ps.Z ** ** or via WWW: http://http.icsi.berkeley.edu/~storn/litera.html* ** A more extended version of tr-95-012.ps is submitted for ** ** publication in the Journal Evolutionary Computation. ** ** ** ** You may use this program for any purpose, give it to any ** ** person or change it according to your needs as long as you ** ** are referring to Rainer Storn and Ken Price as the origi- ** ** nators of the the DE idea. ** ** If you have questions concerning DE feel free to contact ** ** us. We also will be happy to know about your experiences ** ** with DE and your suggestions of improvement. ** ** ** ***************************************************************/ /**H*O*C************************************************************** ** ** ** No.!Version! Date ! Request ! Modification ! Author ** ** ---+-------+------+---------+---------------------------+------- ** ** 1 + 3.1 +5/18/95+ - + strategy DE/rand-to-best/1+ Storn ** ** + + + + included + ** ** 1 + 3.2 +6/06/95+C.Fleiner+ change loops into memcpy + Storn ** ** 2 + 3.2 +6/06/95+ - + update comments + Storn ** ** 1 + 3.3 +6/15/95+ K.Price + strategy DE/best/2 incl. + Storn ** ** 2 + 3.3 +6/16/95+ - + comments and beautifying + Storn ** ** 3 + 3.3 +7/13/95+ - + upper and lower bound for + Storn ** ** + + + + initialization + ** ** 1 + 3.4 +2/12/96+ - + increased printout prec. + Storn ** ** 1 + 3.5 +5/28/96+ - + strategies revisited + Storn ** ** 2 + 3.5 +5/28/96+ - + strategy DE/rand/2 incl. + Storn ** ** 1 + 3.6 +8/06/96+ K.Price + Binomial Crossover added + Storn ** ** 2 + 3.6 +9/30/96+ K.Price + cost variance output + Storn ** ** 3 + 3.6 +9/30/96+ - + alternative to ASSIGND + Storn ** ** 4 + 3.6 +10/1/96+ - + variable checking inserted + Storn ** ** 5 + 3.6 +10/1/96+ - + strategy indic. improved + Storn ** ** ** ***H*O*C*E***********************************************************/ /*#include "de.h"*/ #include #include #include /*#include */ #define UT_DEBUG2 #define UT_DEBUG3 #define UT_DEBUG6 #define PENALTY_POSITIVE #define PENALTY_MODERATE #define PENALTY_UNSTABLE /*#define PENALTY_POSITIVE2*/ #define PENALTY 100 #define MAXPOP 500 #define MAXDIM 52 #define MU (0.1) /*------Constants for rnd_uni()--------------------------------------------*/ #define IM1 2147483563 #define IM2 2147483399 #define AM (1.0/IM1) #define IMM1 (IM1-1) #define IA1 40014 #define IA2 40692 #define IQ1 53668 #define IQ2 52774 #define IR1 12211 #define IR2 3791 #define NTAB 32 #define NDIV (1+IMM1/NTAB) #define EPS 1.2e-7 #define RNMX (1.0-EPS) #define VTR (10) #define STEPSIZE (0.01) /*#define NP (10)*/ #define ITERMAX (3000) /*#define F (0.7)*/ /*#define CR (0.8)*/ #define XVMIN (0) #define XVMAX (1) #define REFLESH (10) #define BIGNUM (-10000000) #define TH (5) #define NE (10) #define NE2 (10) #define TINY (0.000001) #define MAX_NSV (200) #define NPARAMS (21) #define NDIMS (3) #define D (NDIMS) #define P (NPARAMS) /*#define th1 (2)*/ /*#define th2 (13)*/ #define KK (10) #define GAP (0.5) #define GAP2 (0.1) #define GAP3 (0.5) /*------------------------Globals---------------------------------------*/ long rnd_uni_init; /* serves as a seed for rnd_uni() */ /*double c[MAXPOP][MAXDIM], d[MAXPOP][MAXDIM];*/ /*double (*pold)[MAXPOP][MAXDIM], (*pnew)[MAXPOP][MAXDIM], (*pswap)[MAXPOP][MAXDIM];*/ /*---------Function declarations----------------------------------------*/ double h(double x); void assignd(int DD, double a[], double b[]); double rnd_uni(long *idum); /* uniform pseudo random number generator */ /*double evaluate(int D, double tmp[], long *nfeval);*/ /* obj. funct. */ double **file_read(char filename[],int *cc, int *strategy); double **file_read2(char filename[],int *cc, int *strategy, int *cc2); double A(double xx[NDIMS],double *params,double t,double nx[NDIMS],double u); double A2(double xx[NDIMS],double *params,double t,double nx[NDIMS],double u); double cost_function2(double **data,int cc,int DD,double *params,long *nfeval,double **sim); void orig_quick_sort(int *v, int *seq, int left, int right); void randperm(int *ind, int *seq, int cc); void find_params(double **data, double params[NPARAMS], int cc); int ut(double *xhat,double **Pxx,double *y,double **R,double t,double **xsigma,double u); /*void choldc(double **a, int n, double p[]);*/ /*---------Function definitions-----------------------------------------*/ /*void choldc(double **a, int n, double p[]) { int i,j,k; double sum; for (i=0;i=0;k--) sum -= a[i][k]*a[j][k]; if (i == j) { if (sum <= 0.0) fprintf(stderr,"choldc failed, sum:%lf\n",sum); p[i]=sqrt(sum); } else a[j][i]=sum/p[i]; } } } */ double **file_read2(char filename[],int *cc, int *strategy, int *cc2){ double **data; FILE *fp,*fp0; char dummy[100]; char buffer[100]; double u,a,x1,x2,y,t; int i,j,k,l; int cycles; data = NULL; if((fp = fopen(filename,"r")) == NULL){ fprintf(stderr,"file: %s cannot be opened.\n",filename); return data; } fprintf(stderr,"opened file.\n"); /* fgets(dummy,100,fp);*/ fprintf(stderr,"fgeted: %s.\n",dummy); *cc = 0; while(fgets(dummy,100,fp) > 0){ /* fprintf(stderr,"%s\n",dummy);*/ (*cc)++; } fprintf(stderr,"scanned file once: cc = %i\n",*cc); if((data = (double **)malloc(sizeof(double *)*(*cc))) == NULL){ fprintf(stderr,"cannot allocate memory for data.\n"); return data; } fprintf(stderr,"malloced memory for data 1.\n"); for(i=0;i<(*cc);i++){ if((data[i] = (double *)malloc(sizeof(double)*4)) == NULL){ fprintf(stderr,"cannot allocate memory for data.\n"); return data; } } fprintf(stderr,"malloced memory for data 2.\n"); fclose(fp); if((fp = fopen(filename,"r")) == NULL){ fprintf(stderr,"file: %s cannot be opened.\n",filename); return data; } i = 0; /*fgets(dummy,100,fp);*/ while(fgets(dummy,100,fp) > 0){ /*find a patient number.*/ j = 0; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } /* if(j == 0){ t = BIGNUM; }else{ if(buffer[k-1] == ' '){ t = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&t); } }*/ /*find date*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } /* if(k == 0){ g = BIGNUM; }else{ if(buffer[k-1] == ' '){ g = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&g); } } */ /*find the number of days for medication*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } /* if(k == 0){ h = BIGNUM; }else{ if(buffer[k-1] == ' '){ h = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&h); } } */ /*find the number of days for a cycle*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } /* if(k == 0){ p = BIGNUM; }else{ if(buffer[k-1] == ' '){ p = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&p); } } */ /*find psa*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } if(k == 0){ y = BIGNUM; }else{ if(buffer[k-1] == ' '){ y = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&y); } } /*find testosterone*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } if(k == 0){ a = BIGNUM; }else{ if(buffer[k-1] == ' '){ a = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&a); } } /*find cycle*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } /* if(k == 0){ a = BIGNUM; }else{ if(buffer[k-1] == ' '){ a = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&a); } }*/ /*find medication*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } if(k == 0){ u = BIGNUM; }else{ if(buffer[k-1] == ' '){ u = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&u); } } /*find the number of days in total*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } if(k == 0){ t = BIGNUM; }else{ if(buffer[k-1] == ' '){ t = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&t); } } j++; k = 0; while((dummy[j] != '\0')&&(dummy[j] != '\n')&&(dummy[j] != 13)){ buffer[k] = dummy[j]; j++; k++; } /* printf("i=%i,k=%i:",i,k); for(l=0;l=0;j--) { k=(*idum)/IQ1; *idum=IA1*(*idum-k*IQ1)-k*IR1; if (*idum < 0) *idum += IM1; if (j < NTAB) iv[j] = *idum; } iy=iv[0]; } k=(*idum)/IQ1; *idum=IA1*(*idum-k*IQ1)-k*IR1; if (*idum < 0) *idum += IM1; k=idum2/IQ2; idum2=IA2*(idum2-k*IQ2)-k*IR2; if (idum2 < 0) idum2 += IM2; j=iy/NDIV; iy=iv[j]-idum2; iv[j] = *idum; if (iy < 1) iy += IMM1; if ((temp=AM*iy) > RNMX) return RNMX; else return temp; }/*------End of rnd_uni()--------------------------*/ double **file_read(char filename[],int *cc, int *strategy){ double **data; FILE *fp,*fp0; char dummy[100]; char buffer[100]; double u,a,x1,x2,y,t,p; int i,j,k,l; data = NULL; if((fp = fopen(filename,"r")) == NULL){ fprintf(stderr,"file: %s cannot be opened.\n",filename); return data; } fprintf(stderr,"opened file.\n"); /* fgets(dummy,100,fp);*/ fprintf(stderr,"fgeted: %s.\n",dummy); *cc = 0; while(fgets(dummy,100,fp) > 0){ /* fprintf(stderr,"%s\n",dummy);*/ (*cc)++; } fprintf(stderr,"scanned file once: cc = %i\n",*cc); if((data = (double **)malloc(sizeof(double *)*(*cc))) == NULL){ fprintf(stderr,"cannot allocate memory for data.\n"); return data; } fprintf(stderr,"malloced memory for data 1.\n"); for(i=0;i<(*cc);i++){ if((data[i] = (double *)malloc(sizeof(double)*3)) == NULL){ fprintf(stderr,"cannot allocate memory for data.\n"); return data; } } fprintf(stderr,"malloced memory for data 2.\n"); fclose(fp); if((fp = fopen(filename,"r")) == NULL){ fprintf(stderr,"file: %s cannot be opened.\n",filename); return data; } i = 0; /* fgets(dummy,100,fp);*/ while(fgets(dummy,100,fp) > 0){ /*find psa.*/ j = 0; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } if(j == 0){ y = BIGNUM; }else{ if(buffer[k-1] == ' '){ y = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&y); } } /*find the number of cycle*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } /* if(k == 0){ g = BIGNUM; }else{ if(buffer[k-1] == ' '){ g = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&g); } }*/ /*find the medication procedure*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } if(k == 0){ u = BIGNUM; }else{ if(buffer[k-1] == ' '){ u = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&u); } } /*find the number of days*/ j++; k = 0; while(dummy[j] != ','){ buffer[k] = dummy[j]; j++; k++; } if(k == 0){ t = BIGNUM; }else{ if(buffer[k-1] == ' '){ t = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&t); } } /*find the patient number*/ j++; k = 0; while(dummy[j] != '\n'){ buffer[k] = dummy[j]; j++; k++; } if(k == 0){ p = BIGNUM; }else{ if(buffer[k-1] == ' '){ p = BIGNUM; }else{ buffer[k] = ','; sscanf(buffer,"%lg,",&p); } } fprintf(stderr,"y=%f,u=%f,t=%f,p=%f\n",y,u,t,p); data[i][0] = y; data[i][1] = u; data[i][2] = t; data[i][3] = p; i++; } fprintf(stderr,"scanned the file second time\n"); fclose(fp); fprintf(stderr,"closed file.\n"); return data; } double A(double xx[NDIMS],double *params,double t,double nx[NDIMS],double u){ int i,j,k,n; double temp[NDIMS],temp2; int temp3; for(i=0;i , if ** ** the executable file is called de1. ** ** The input file must contain valid inputs accor- ** ** ding to the fscanf() section of main(). ** ** ** ** POSTCONDITIONS :main() produces consecutive console outputs and ** ** writes the final results in an output file if ** ** the program terminates without an error. ** ** ** ***C*F*E*************************************************************/ { char chr; /* y/n choice variable */ int i, j, k, l, L, n, ii; /* counting variables */ int r1, r2; /* placeholders for random indexes */ int r5; /* placeholders for random indexes */ int NP; /* number of population members */ int imin; /* index to member with lowest energy */ int refresh; /* refresh rate of screen output */ int refresh2 = 1; /* refresh rate of screen output */ int strategy = 1; /* choice parameter for screen output */ int gen, genmax, seed; long nfeval; /* number of function evaluations */ double trial_cost; /* buffer variable */ double inibound_h; /* upper parameter bound */ double inibound_l; /* lower parameter bound */ double *tmp, *best, *best2, *bestit; /* members */ double cost[MAXPOP]; /* obj. funct. values */ double cvar; /* computes the cost variance */ double cmean; /* mean cost */ double F,CR; /* control variables of DE */ double cmin, minti; /* help variables */ double **data; double **sim; int cc, cc2 = 100; int quick_check; FILE *fpin_ptr, *fp; double prev_cmin = 0; int nsv = 0; int c_quick = 0; int seq[100]; int dd = 0; double xhat[D+P]; double temp,temp2; double var[D]; int count; double **R; double Q[D][D]; double **Pxx; double **xsigma; int ut_count; double **c, **d; double ***pold, ***pnew, ***pswap; double xin[3]; double xx[3]; double u; double th1 = 15, th2 = 2; int DP; DP = D + P; /*------Initializations----------------------------*/ if (argc != 2) /* number of arguments */ { printf("\nUsage : bip2005 \n"); exit(1); } /*-----Read input data------------------------------------------------*/ genmax = 10000; refresh = 10; NP = (P)*10; inibound_h = 1; inibound_l = -1; F = 0.7; CR = 0.8; seed = 11; seed = (int)time(0); printf("seed=%i\n",seed); /*-----Checking input variables for proper range----------------------------*/ if (D > MAXDIM) { printf("\nError! D=%d > MAXDIM=%d\n",D,MAXDIM); exit(1); } if (D <= 0) { printf("\nError! D=%d, should be > 0\n",D); exit(1); } if (NP > MAXPOP) { printf("\nError! NP=%d > MAXPOP=%d\n",NP,MAXPOP); exit(1); } if (NP <= 0) { printf("\nError! NP=%d, should be > 0\n",NP); exit(1); } if ((CR < 0) || (CR > 1.0)) { printf("\nError! CR=%lf, should be ex [0,1]\n",CR); exit(1); } if (seed <= 0) { printf("\nError! seed=%d, should be > 0\n",seed); exit(1); } if (refresh <= 0) { printf("\nError! refresh=%d, should be > 0\n",refresh); exit(1); } if (genmax <= 0) { printf("\nError! genmax=%d, should be > 0\n",genmax); exit(1); } if (inibound_h < inibound_l) { printf("\nError! inibound_h=%lf < inibound_l=%lf\n",inibound_h, inibound_l); exit(1); } /*-----read data------------------------------------------------------*/ data = file_read2(argv[1],&cc,&strategy,&cc2); strategy = 8; cc2 = cc; /* sscanf(argv[2],"%i\n",&cc2); sscanf(argv[3],"%lf\n",&th1); sscanf(argv[4],"%lf\n",&th2); printf("cc2=%i, th1=%lf, th2=%lf\n",cc2,th1,th2);*/ fpin_ptr = fopen("input.dat","w"); fprintf(fpin_ptr,"TIME,PSA,MED\n"); i = 0; fprintf(fpin_ptr,"%.3f,%.2E,%.2E\n",data[i][2],data[i][0],data[i][1]); for(i=1;i0);i++){ seq[i] = dd; dd = dd/2; } */ /*-----Initialize random number generator-----------------------------*/ quick_check = 0; rnd_uni_init = -(long)seed; /* initialization of rnd_uni() */ nfeval = 0; /* reset number of function evaluations */ fprintf(stderr,"multiple shooting with short integral interval, seed:%i\n",seed); /*------Initialization------------------------------------------------*/ /*------Right now this part is kept fairly simple and just generates--*/ /*------random numbers in the range [-initfac, +initfac]. You might---*/ /*------want to extend the init part such that you can initialize-----*/ /*------each parameter separately.------------------------------------*/ fprintf(stderr,"initialization\n"); for (i=0; i= 0) == 0)){ inibound_l = 15; inibound_h = 5; c[i][0] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 1; inibound_h = 0; c[i][1] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 1; inibound_h = 0; c[i][2] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 1.2; inibound_h = 0.8; c[i][3] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0.0; c[i][4] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 1.2; inibound_h = 0.8; c[i][5] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0.0; c[i][6] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0; c[i][7] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 1.2; inibound_h = 0.8; c[i][8] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 1.2; inibound_h = 0.8; c[i][9] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0.0; c[i][10] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 1.2; inibound_h = 0.8; c[i][11] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 1.2; inibound_h = 0.8; c[i][12] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0.0; c[i][13] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0.0; c[i][14] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0.0; c[i][15] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0.0; c[i][16] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0.0; c[i][17] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0.0; c[i][18] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0; inibound_h = 0; c[i][19] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0; inibound_h = 0; c[i][20] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); /* inibound_l = 0.0; inibound_h = 0.0; c[i][21] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0.0; c[i][22] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0.0; c[i][23] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0; c[i][24] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0; c[i][25] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0; c[i][26] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0; c[i][27] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.0; inibound_h = 0; c[i][28] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0; inibound_h = 0; c[i][29] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0; inibound_h = 0; c[i][30] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); */ /* inibound_l = 30; inibound_h = 0; c[i][31] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); */ /* inibound_l = 0.2; inibound_h = 0; c[i][32] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0; c[i][33] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0; c[i][34] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0; c[i][35] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0; c[i][36] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0; c[i][37] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0; c[i][38] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); inibound_l = 0.2; inibound_h = 0; c[i][39] = inibound_l + rnd_uni(&rnd_uni_init)*(inibound_h - inibound_l); */ /* cost[i] = cost_function(data,seq[dd],D,c[i],&nfeval);*/ /* obj. funct. value */ cost[i] = cost_function2(data,cc2,D,c[i],&nfeval,sim); /* obj. funct. value */ } /* for(j=0;j= 1)||((cmin < 1)&&(quickly_check_goodness(data,best,cc2) == 0))))*/ /* remove comments if conio.h */ fprintf(stderr,"start differential evolution.\n"); while (gen < genmax){ /* is accepted by compiler */ gen++; imin = 0; if(cmin == prev_cmin)nsv++; prev_cmin = cmin; for (i=0; i