/* C++ source code for EvolGenius v6.1 for Windows and Mac/Unix Richard M. Kliman (2014) */ /* Floating point issue in summing of migrant genotype proportions led to erroneous warning that proportions exceeded 1.0. This only happened in Windows. The code has been modified to work around the rounding error. - Feb 16, 2015 */ #include #include #include #include #include #include #include #include using namespace std; #define FMax 100 #define SMax 500 #define NMax 1000000 #define IMax 50000 #define GMax 9999999 /* FMax = maximum length of a filename */ /* SMax = maximum length of general character string */ /* NMax = maximum population size */ /* IMax = maximum number of iterations */ /* GMax = maximum number of generations allowed per iteration */ /* output file */ ofstream datafl; /* .csv file with run data */ ofstream sumfl; /* .txt file with run setting */ char onm[FMax]; /* output file prefix */ char datanm[FMax]; /* name of .csv file */ char sumnm[FMax]; /* name of .txt file */ /* general use variables */ char strng[10]; /* general use string variable */ char fchar; /* general use character variable */ double rVal; /* random real value b/n 0 and 1 */ int chk,chk2; /* general use boolean */ long calcVal; /* general use longint value */ double calcVal2; /* general use double value */ /* program settings */ int rsd; /* random number generator seed */ long nIter; /* number of iterations */ long genMax; /* maximum number of generations per iteration */ long resMax; /* maximum number of generations for screen output resolution*/ long N[3][3]; /* number of individuals w/ each genotype */ long NTot; /* total number of individuals in population */ double w[3][3]; /* fitnesses of genotypes */ int doMig; /* boolean: 1=allow migration */ double migN; /* average number of immigrants/generation */ double migP; /* probability of migration (migN / NTot); */ double migF[3][3]; /* genotype proportions of immigrants */ double migCumF[3][3]; /* cumulative genotype proportions of immigrants */ double mutA[2]; /* 0: A>a mutation rate 1: a>A mutation rate */ double mutB[2]; /* 0: B>b mutation rate 1: b>B mutation rate */ double rec_cM; /* recombination rate in cM (0-50) b/n A and B */ double rec; /* recombination rate in freq (0-0.5) b/n A and B */ int mateRule; /* mating rules: 0=self-fert not allowed; 1=self-fert allowed; 2=enforced monogamy */ int trackCopies;/* boolean: 1=track gene copy histories */ int setAllFix[2]; /* check for allele-specific allele fixation element 0 = Alpha 0=any, 1=A, 2=a element 1 = Beta 0=any, 1=B, 2=b */ int stopAtFix; /* boolean: 1=stop iteration upon allele and gene copy fixation*/ /* other program variables */ double trust; /* used to determine if sum stats should be calculated */ long rep; /* replicate being performed */ int contIter; /* boolean: continue iteration */ int doProgAgain;/* boolean: 1=run the program again */ int doSeed; /* boolean: 1=get random number seed */ long gen; /* generation of iteration */ int firstRun; /* boolean: 1=first run of program */ int fitCheck; /* genotype differ in fitness */ int mutCheck; /* some mutation is allowed */ int mateCheck; /* nonrandom mating: 0 = random mating; 1 = postmating isolation; 2 = premating isolation */ int whichMating[3][3]={0,1,2,1,3,4,2,4,5}; /* identifies which of the 6 possible matings has been chosen AA Aa aa AA 0 1 2 Aa 1 3 4 aa 2 4 5 */ int varyAInit; /* set to 0 if population starts entirely AA or aa */ int varyBInit; /* set to 0 if population starts entirely BB or bb */ long startPop[3][3]; /* number of individuals in starting population with the following genotypes: 00=AABB 01=AABb 02=AAbb 10=AaBB 11=AaBb 12=Aabb 20=aaBB 21=aaBb 22=aabb */ double startF[3][3]; /* starting genotype proportions */ double matePref[6]; /* relative mating prefs (range from 0 to 1) matePref[0]: AA with AA matePref[1]: AA with Aa matePref[2]: AA with aa matePref[3]: Aa with Aa matePref[4]: Aa with aa matePref[5]: aa with aa */ /* data & results */ struct info { int AAll[2]; long AID[2]; int AHap[2]; int BAll[2]; long BID[2]; int BHap[2]; struct info *next; }; /* AAll: 0=A, 1=a; BAll: 0=B, 1=b */ /* each allele is part of an initial haplotype: AHap[], BHap[]: 0=AB 1=Ab 2=aB 3=ab This must be recorded, because it can not be inferred for dihybrids */ struct info *pIND; struct info *pNIND; struct info *pPERMUTEIND; double *pRand; /* pointer to array of random numbers for permutation of starting pop */ struct info mIND[10]; /* used for immigration -- see RUNINIT() */ long *pMated; /* used when monogamy is enforced; -1 if unmated; array pos of mate if mated */ double f[3][3]; /* proportions of genotypes */ int fixedAAll; /* 0: A fixed; 1: a fixed; 2: neither fixed */ int fixedBAll; /* 0: B fixed; 1: b fixed; 2: neither fixed */ long totAFixed[3]; /* number of times A [0] or a [1] allele fixed; neither[2] */ long totBFixed[3]; /* number of times B [0] or b [1] allele fixed; neither[2] */ long fixedACopy; /* ID of MRCA of fixed A copies; -1 if never fixed */ long fixedBCopy; /* ID of MRCA of fixed B copies; -1 if never fixed */ long noFixedACopy; /* number of times no A copy fixed */ long noFixedBCopy; /* number of times no B copy fixed */ long genFixedAAll; /* generation at which A or a allele is fixed; genMax+1 if never */ long genFixedBAll; /* generation at which B or b allele is fixed; genMax+1 if never */ long genFixedACopy; /* generation at which A gene copy is fixed; genMax+1 if never */ long genFixedBCopy; /* generation at which B gene copy is fixed; genMax+1 if never */ int ancAHap; /* haplotype of MRCA for A gene at time of fixation 0=AB 1=Ab 2=aB 3=ab*/ int ancBHap; /* haplotype of MRCA for B gene - see above */ int iterExtinct; /* extinction in iteration */ long nIterExtinct; /* number of iterations leading to extinction */ /* statistics */ long sumGenFixedAAll; /* cumulative sums of fixation generations*/ long sumGenFixedBAll; long sumGenFixedACopy; long sumGenFixedBCopy; long sumGenFixedAAll2; /* cumulative sums of (fixation generations)^2 */ long sumGenFixedBAll2; long sumGenFixedACopy2; long sumGenFixedBCopy2; /* genotype arrays (for convenience) */ char aGType[3][3]={"AA","Aa","aa"}; char bGType[3][3]={"BB","Bb","bb"}; char haplo[4][3]={"AB","Ab","aB","ab"}; /* prototypes */ void GIVEUP(void); /* halts program gracefully */ void SEEDRND(void); /* assigns random number generator seed */ int RNDI(void); /* used in random number generation */ double RANDREAL(void); /* generates higher resolution random number between 0 and 1 */ int GF_INTCHK(void); /* called to see that keyboard input is a valid integer */ int GF_REALCHK(void); /* called to see that keyboard input is a valid real # */ void OUTFILE(void); /* assigns output file names */ void STARTDEF(void); /* sets default values for certain variables */ void START(void); /* main menu for program settings */ void MEMALLOC(void); /* allocates memory for population arrays */ void RUNINIT(void); /* initializes variables for entire program run */ void ITERINIT(void); /* initializes variables for a given iteration */ void SHUFFLE(void); /* shuffles the starting population to minimize randnum biases */ void POPBUILD(void); /* builds the population for generation 0 */ void MUTATE(void); /* mutation algorithm */ void FREQCALC(void); /* calculates proportions */ void EXCHANGE(void); /* replaces parent generation with offspring */ void ADDNEW(void); /* adds results to variables for summary stats */ void OUTWRITE(void); /* writes iteration results to output file */ void CONTCHK(void); /* checks to see if iteration can continue */ void COALESCE(void); /* checks for gene copy fixation if trackCopies=1*/ void ALCOMP(void); /* checks for allele fixation */ void GENBUILD(void); /* builds new generation */ void AGAIN(void); /* prompts user to run program again */ void SUMSTATS(void); /* performs summary statistics calculations */ void GIVEUP(void) { cout <<"\nEvolGenius 6.1 halted."<>32768 (e.g., as it is using the g++ compiler in Mac/Unix), y can only be 32768 when random number is RAND_MAX, which should be very rare. Therefore, this result can be pooled with "real" 32767's. If RAND_MAX is 32767 (e.g., as it is in Visual C++ for Win), y can be 32766 or 32768 with equal probability, but not 32767. Therefore, 32768 can be converted to 32767. NOTE: there may be values of RANDMAX for which this approach is unsuitable!!! */ if(y==32768) y=32767; return((int)y); } double RANDREAL(void) { int a; long checkRand[2]; long calcVal; double calcVal2; for(a=0;a<2;a++) checkRand[a]=RNDI(); calcVal=32768*checkRand[0]+checkRand[1]; calcVal2=(double)calcVal/1073741824; return((double)calcVal2); } int GF_INTCHK(char instrng[SMax]) { int a; for(a=0;a>strng; strcpy(onm,strng); /* assign filename prefix */ strcpy(datanm,onm); /* copy prefix to .csv filename */ strcpy(sumnm,onm); /* copy prefix to .txt filename */ strcat(datanm,".csv\0"); strcat(sumnm,".txt\0"); datafl.clear(); datafl.open(datanm,ios::out); if(datafl.fail()) { cout<<"\aTHE FILE "< TO QUIT "< FOR NEW FILENAME.> "<>strng; fchar=toupper(strng[0]); } if(fchar=='Q') GIVEUP(); datafl.clear(); } else chk=1; sumfl.clear(); sumfl.open(sumnm,ios::out); if(sumfl.fail()) { cout<<"\aTHE FILE "< TO QUIT "< FOR NEW FILENAME.> "<>strng; fchar=toupper(strng[0]); } if(fchar=='Q') GIVEUP(); sumfl.clear(); } else chk=1; } datafl.close(); sumfl.close(); } void STARTDEF(void) { int a,b; genMax=30000; /* default: 30000 max generations */ startPop[0][0]=10; /* default: 1:2:1:2:4:2:1:2:1 genotype ratio */ startPop[0][1]=20; startPop[0][2]=10; startPop[1][0]=20; startPop[1][1]=40; startPop[1][2]=20; startPop[2][0]=10; startPop[2][1]=20; startPop[2][2]=10; NTot=0; for(a=0;a<3;a++) for(b=0;b<3;b++) { NTot+=startPop[a][b]; /* calculate pop size */ w[a][b]=1.0; /* set all relative fitnesses to 1.0 */ } /* calculate starting genotype proportions */ for(a=0;a<3;a++) for(b=0;b<3;b++) startF[a][b]=(double)startPop[a][b]/NTot; for(a=0;a<2;a++) { mutA[a]=0.0; /* default: no mutation */ mutB[a]=0.0; } nIter=1; /* default: 1 iteration */ mateRule=1; /* default: self-fertilization is allowed */ for(a=0;a<6;a++) matePref[a]=1.0; /* default: random mating */ trackCopies=1; /* default: track gene copy history */ setAllFix[0]=0; /* default: can fix either Alpha allele */ setAllFix[1]=0; /* default: can fix either Beta allele */ stopAtFix=1; /* default: stop iteration upon fixation */ } void START(void) { int a,b,c; int StepP=0; /* to change starting population */ int StepM=0; /* to change maximum number of generations */ int StepW=0; /* to change fitness values */ int StepL=0; /* to change linkage map distance */ int StepD=0; /* to change migration settings */ int Step1=0; /* to change mutation rate of A to a */ int Step2=0; /* to change mutation rate of a to A */ int Step3=0; /* to change mutation rate of B to b */ int Step4=0; /* to change mutation rate of b to B */ int StepI=0; /* to change number of iterations */ int StepF=0; /* to toggle allow self-fertilization */ int StepN=0; /* to change relative mating preferences */ int StepG=0; /* to toggle tracking of gene copies */ int StepA=0; /* to toggle allele fixation setting */ int StepV=0; /* to toggle stop at fixation */ int nfail; int startAGtype[3]; /* number of individuals w/ AA, Aa and aa gtypes */ char chng='0'; /* menu option chosen */ long tVal; /* typed value at prompt (later converted to number) */ double wMax,mateMax; /* used to calculate relative values */ double migCum; /* used to calculate migCumF */ /* check to be sure simulation can run given initial settings*/ int fertChk; /* 1 if enough fertile individuals to continue */ int mateChk; /* 1 if mating is possible */ int migChk; /* 1 if more immigrants than total population size */ OUTFILE(); chk=1; while(chk) { cout<<"Random number generator seed [integer, 1 - 32767]: "<>strng; if(GF_INTCHK(strng)) { tVal=atol(strng); if(tVal>0 && tVal<32767) { chk=0; rsd=(int)tVal; } } if(chk) cout<<"\a\nBad seed. Try again."<>strng; if(GF_INTCHK(strng)) { tVal=atol(strng); if(tVal>=0) { chk=1; startPop[a][b]=(long)tVal; } } if(!chk) cout<<"\a\nBad number. Try again."<0 && NTot<=NMax) StepP=0; else { if(NTot==0) cout<<"\a\nPopulation size is zero."<NMax) cout<<"\a\nPopulation size exceeds "<>strng; if(GF_INTCHK(strng)) { tVal=atol(strng); if(tVal>0 && tVal<=GMax) { StepM=0; genMax=(long)tVal; } } if(StepM) cout<<"\a\nBad number. Try again."<>strng; if(GF_REALCHK(strng)) { w[a][b]=atof(strng); if(w[a][b]>=0.0 && w[a][b]<=1.0) chk=1; } if(!chk) cout<<"\a\nBad value. Try again."<wMax) wMax=w[a][b]; for(a=0;a<3;a++) for(b=0;b<3;b++) w[a][b]=w[a][b]/wMax; StepW=0; } while(StepL) { cout<<"You must specify the map distance between"<>strng; if(GF_REALCHK(strng)) { rec_cM=atof(strng); if(rec_cM>=0.0 && rec_cM<=50.0) { rec=rec_cM/100; StepL=0; } } if(StepL) cout<<"\a\nBad value. Try again."<-0.000000000000001 && migF[2][2]<0.0000000000001) migF[2][2]=0; chk=1; } else /* enter other proportions */ { cout<<"Proportion of "<>strng; if(GF_REALCHK(strng)) { migF[a][b]=(double)(atof(strng)); if(migF[a][b]>=0.0 && migF[a][b]<=1.0) chk=1; } if(!chk) cout<<"\a\nBad value. Try again."<0.0 - <"<>strng; if(GF_REALCHK(strng)) { migN=atof(strng); if(migN>0.0 && migN to continue "<>strng; fchar=toupper(strng[0]); } } } else { doMig=0; migN=0.0; migP=0.0; StepD=0; } } while(Step1) { cout<<"Mutation rate of A to a [0.0 - 1.0]: "<>strng; if(GF_REALCHK(strng)) { mutA[0]=atof(strng); if(mutA[0]>=0.0 && mutA[0]<=1.0) Step1=0; } if(Step1) cout<<"\a\nBad value. Try again."<>strng; if(GF_REALCHK(strng)) { mutA[1]=atof(strng); if(mutA[1]>=0.0 && mutA[1]<=1.0) Step2=0; } if(Step2) cout<<"\a\nBad value. Try again."<>strng; if(GF_REALCHK(strng)) { mutB[0]=atof(strng); if(mutB[0]>=0.0 && mutB[0]<=1.0) Step3=0; } if(Step3) cout<<"\a\nBad value. Try again."<>strng; if(GF_REALCHK(strng)) { mutB[1]=atof(strng); if(mutB[1]>=0.0 && mutB[1]<=1.0) Step4=0; } if(Step4) cout<<"\a\nBad value. Try again."<>strng; if(GF_INTCHK(strng)) { tVal=atol(strng); if(tVal>0 && tVal>strng; if(GF_REALCHK(strng)) { matePref[a]=atof(strng); if(matePref[a]>=0.0 && matePref[a]<=1.0) chk=1; } if(!chk) cout<<"\a\nBad value. Try again."<mateMax) mateMax=matePref[a]; for(a=0;a<6;a++) matePref[a]=matePref[a]/mateMax; mateCheck=0; /* default: there are no mating preferences */ for(a=0;a<6 && !mateCheck;a++) if(matePref[a]<1) { chk=0; do { cout<<"\nYou have indicated that there are mating preferences."<>strng; if(GF_INTCHK(strng)) { chk=1; tVal=atol(strng); if(tVal==1) mateCheck=1; else if(tVal==2) mateCheck=2; else chk=0; } if(!chk) cout<<"Invalid choice. Try again."< to continue. "<>strng; fchar=toupper(strng[0]); } } else trackCopies=1; } StepG=0; } if(StepA) { cout<<"If you do not care which Alpha allele fixes, type 0."<>strng; if(GF_INTCHK(strng)) { tVal=atol(strng); if(tVal>=0 && tVal<=2) { chk=0; setAllFix[0]=(int)tVal; } } if(chk) cout<<"\a\nBad value. Try again."<>strng; if(GF_INTCHK(strng)) { tVal=atol(strng); if(tVal>=0 && tVal<=2) { chk=0; setAllFix[1]=(int)tVal; } } if(chk) cout<<"\a\nBad value. Try again."<0 || setAllFix[1]>0) { cout<<"\nWARNING:"< to continue. "<>strng; fchar=toupper(strng[0]); } } StepA=0; } if(StepV) { if(stopAtFix) stopAtFix=0; else stopAtFix=1; StepV=0; } for(a=0;a<25;a++) cout<a: "<A: "<b: "<B: "< for the field you wish "< to run the simulation(s). Type ""Q"" to quit. "<>strng; chng=toupper(strng[0]); if(chng=='Q') GIVEUP(); switch(chng) { case 'P': case 'M': case 'W': case 'L': case 'F': case '1': case '2': case '3': case '4': case 'I': case 'N': case 'G': case 'D': case 'A': case 'V': case 'C': {chk=1; break;} default: nfail++; if(nfail==1) cout<<"\aTRY AGAIN "< "; } } if(chng=='P') StepP=1; if(chng=='M') StepM=1; if(chng=='W') StepW=1; if(chng=='L') StepL=1; if(chng=='1') Step1=1; if(chng=='2') Step2=1; if(chng=='3') Step3=1; if(chng=='4') Step4=1; if(chng=='I') StepI=1; if(chng=='F') StepF=1; if(chng=='N') StepN=1; if(chng=='G') StepG=1; if(chng=='D') StepD=1; if(chng=='A') StepA=1; if(chng=='V') StepV=1; fertChk=1; c=0; /* number of fertile individuals */ for(a=0;a<3;a++) for(b=0;b<3;b++) if(w[a][b]>0) c+=startPop[a][b]; if(mateRule && !c) /* either self-fert allowed or enforced monogamy, with no fertile inds */ { for(a=0;a<25;a++) cout< to continue. "<>strng; fchar=toupper(strng[0]); } } mateChk=0; startAGtype[0]=startPop[0][0]+startPop[0][1]+startPop[0][2]; startAGtype[1]=startPop[1][0]+startPop[1][1]+startPop[1][2]; startAGtype[2]=startPop[2][0]+startPop[2][1]+startPop[2][2]; if(startAGtype[0]+mateRule>1 && matePref[0]>0.0) mateChk=1; if(!mateChk) if(startAGtype[1]+mateRule>1 && matePref[3]>0.0) mateChk=1; if(!mateChk) if(startAGtype[2]+mateRule>1 && matePref[5]>0.0) mateChk=1; if(!mateChk) if(startAGtype[0] && startAGtype[1] && matePref[1]>0.0) mateChk=1; if(!mateChk) if(startAGtype[0] && startAGtype[2] && matePref[2]>0.0) mateChk=1; if(!mateChk) if(startAGtype[1] && startAGtype[2] && matePref[4]>0.0) mateChk=1; if(!mateChk) { cout<<"\a\n\n\nThere are no allowable matings."< to continue. "<>strng; fchar=toupper(strng[0]); } } migChk=1; if(migN>NTot) { migChk=0; cout<<"\a\n\nYou have changed your initial population size."< to continue. "<>strng; fchar=toupper(strng[0]); } } } while(chng!='C' || !fertChk || !mateChk || !migChk); SEEDRND(); fitCheck=0; for(a=0;a<3;a++) for(b=0;b<3;b++) if(w[a][b]<1.0) fitCheck=1; mutCheck=0; if(mutA[0]>0.0 || mutA[1]>0.0 || mutB[0]>0.0 || mutB[1]>0.0) mutCheck=1; datafl.open(datanm,ios::out); sumfl.open(sumnm,ios::out); sumfl<<"EvolGenius v6.1 by R.M. Kliman (2014)"<2 */ } for(a=0;a=0) parent[1]=pMated[parent[0]]; /* Self-mating is not allowed; also if monogamy and parent[0] needs a mate */ if(parent[1]==parent[0] || (mateRule==2 && pMated[parent[0]]==-1)) parent[1]=NTot; { while(parent[1]==NTot) { parent[1]=(int)(RANDREAL()*NTot); if(parent[1]==parent[0]) parent[1]=NTot; /* if monogamy and parent[0] has not mated before, be sure mate has also not mated before */ if(mateRule==2) if(pMated[parent[1]]>=0) parent[1]=NTot; } } } /* get parent[b] A genotype */ gTypeParA[b]=pIND[parent[b]].AAll[0]+pIND[parent[b]].AAll[1]; /* get parent[b] B genotype */ gTypeParB[b]=pIND[parent[b]].BAll[0]+pIND[parent[b]].BAll[1]; /* if premating isolation and second parent is being selected */ if(b==1 && mateCheck==2) if(RANDREAL()>matePref[whichMating[gTypeParA[0]][gTypeParA[1]]]) chk=0; if(chk && fitCheck) /* selection */ if(RANDREAL()>w[gTypeParA[b]][gTypeParB[b]]) chk=0; } } /* if postmating isolation and both parents have been selected, make sure mating is allowed */ letMate=1; if(mateCheck==1) if(RANDREAL()>matePref[whichMating[gTypeParA[0]][gTypeParA[1]]]) letMate=0; if(letMate && mateRule==2) { if(pMated[parent[0]]==-1) pMated[parent[0]]=parent[1]; if(pMated[parent[1]]==-1) pMated[parent[1]]=parent[0]; } } /* building offspring genotype */ for(b=0;b<2;b++) { if(RANDREAL()<0.5) c=0; else c=1; pNIND[a].AAll[b]=pIND[parent[b]].AAll[c]; pNIND[a].AID[b] =pIND[parent[b]].AID[c]; pNIND[a].AHap[b]=pIND[parent[b]].AHap[c]; /* opportunity for recombination if recombination is allowed */ if(rec>0) { rVal=RANDREAL(); if(rVal0) c+=N[a][b]; if((mateRule==1 && !c) || (mateRule!=1 && c<2)) { contIter=0; iterExtinct=1; } /* checking for allowable matings, assuming there are fit parents */ if(mateCheck && !iterExtinct) { AGtype[0]=N[0][0]+N[0][1]+N[0][2]; AGtype[1]=N[1][0]+N[1][1]+N[1][2]; AGtype[2]=N[2][0]+N[2][1]+N[2][2]; c=0; if(AGtype[0]>0 && matePref[0]>0.0) c=AGtype[0]; if(mateRule!=1) c--; if(!c) { if(AGtype[1]>0 && matePref[3]>0.0) c=AGtype[1]; if(mateRule==1) c--; } if(!c) { if(AGtype[2]>0 && matePref[5]>0.0) c=AGtype[2]; if(mateRule==1) c--; } if(!c) if(AGtype[0] && AGtype[1] && matePref[1]>0.0) c=1; if(!c) if(AGtype[0] && AGtype[2] && matePref[2]>0.0) c=1; if(!c) if(AGtype[1] && AGtype[2] && matePref[4]>0.0) c=1; if(!c) { contIter=0; iterExtinct=1; } } } void ADDNEW(void) { if(!iterExtinct) { if(fixedAAll<2) { totAFixed[fixedAAll]++; sumGenFixedAAll+=genFixedAAll; sumGenFixedAAll2+=(genFixedAAll*genFixedAAll); } else totAFixed[2]++; if(fixedBAll<2) { totBFixed[fixedBAll]++; sumGenFixedBAll+=genFixedBAll; sumGenFixedBAll2+=(genFixedBAll*genFixedBAll); } else totBFixed[2]++; if(trackCopies) { if(genFixedACopy1) meanAAll=(double)sumGenFixedAAll/(totAFixed[0]+totAFixed[1]); if((totBFixed[0]+totBFixed[1])>1) meanBAll=(double)sumGenFixedBAll/(totBFixed[0]+totBFixed[1]); if(trackCopies) { if(((rep-1)-noFixedACopy)>1) meanACopy=(double)sumGenFixedACopy/((rep-1)-noFixedACopy); if(((rep-1)-noFixedBCopy)>1) meanBCopy=(double)sumGenFixedBCopy/((rep-1)-noFixedBCopy); } sumfl<1) sumfl<1) sumfl<1) sumfl<1) sumfl<>strng; fchar=toupper(strng[0]); cout<>strng; fchar=toupper(strng[0]); if(fchar=='N' || fchar=='Y') chk=1; } if(fchar=='Y') doProgAgain=1; else doProgAgain=0; if(doProgAgain) firstRun=0; cout<1) SUMSTATS(); datafl.close(); sumfl.close(); AGAIN(); } cout<<"\n\nEvolGenius 6.1 done."<