<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hello,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Would you please help me in the following requests:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>1-In my program&nbsp;I have a for loop in each iteration&nbsp;I have to make a genetic algorithm run my problem is :how before starting the genetic algorithm run&nbsp;&nbsp;&nbsp;I&nbsp;can send two arguments to the objective function, these arguments&nbsp;must be used in a formula to&nbsp;evaluate the real genome&nbsp;&nbsp; one of them depend on the index of the loop.,,so how I have to declare&nbsp; and invok my objective function to receive three arguments ,the first is the standard argument GAGenome&amp;g&nbsp;then mytwo&nbsp; arguments. A portion of the code&nbsp; is below, I have gotten this code from example21 but I have added the loop cause I need to do a number of genetic algorithm run.</DIV>
<DIV>&nbsp;</DIV><FONT size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>float</FONT></FONT><FONT color=#0000bf size=2> Objective1(GAGenome&amp; g)</FONT></DIV>
<DIV><FONT color=#008000><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT color=#008000><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int<FONT size=2> length = n;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>GARealAlleleSet alleles1;</DIV>
<DIV>alleles1.add(0.0);</DIV>
<DIV>alleles1.add(1.0);</DIV>
<DIV>GARealGenome genome1(length, alleles1,Objective1);</DIV></FONT>
<DIV>&nbsp;</DIV>
<DIV>GAParameterList params;</DIV>
<DIV>GASteadyStateGA::registerDefaultParameters(params);</DIV>
<DIV>params.set(gaNnGenerations, 500);</DIV>
<DIV>params.set(gaNpopulationSize, 110);</DIV>
<DIV>params.set(gaNscoreFrequency, 10);</DIV>
<DIV>params.set(gaNflushFrequency, 50);</DIV>
<DIV>params.set(gaNselectScores, (<FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2>)GAStatistics::AllScores);</DIV>
<DIV>params.parse(argc, argv, gaFalse);</DIV></FONT>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#0000bf>for</FONT></FONT></FONT><FONT size=2><FONT color=#0000bf>(j=0 ; j&lt;size;j++)</FONT></DIV>
<DIV><FONT color=#0000bf>{</FONT><FONT size=2><FONT size=2><FONT color=#ff007f>//Here the objective function should receive the two arguments one of them is the index of the loop</FONT></DIV>
<DIV><FONT color=#ff007f><FONT color=#0000bf>//</FONT><FONT size=2><FONT size=2><FONT size=2><FONT color=#0000bf>Begin Genetic run</FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT color=#0000bf>GASteadyStateGA ga1(genome1);</FONT></DIV>
<DIV><FONT color=#0000bf>ga1.parameters(params);</FONT></DIV>
<DIV><FONT color=#0000bf>ga1.set(gaNscoreFilename, </FONT></FONT><FONT color=#0000bf><FONT size=2><FONT size=2>"bog1.dat"</FONT></FONT><FONT size=2>);</DIV></FONT></FONT><FONT color=#0000bf size=2>
<DIV>ga1.evolve(seed);</DIV></FONT><FONT size=2><FONT color=#0000bf size=2>
<DIV>//End Genetic run</DIV></FONT></FONT>
<DIV><FONT color=#0000bf>}</FONT></DIV>
<DIV><FONT color=#0000bf></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000bf></FONT>&nbsp;</DIV>
<DIV><FONT color=#111111>2-If I want&nbsp; to receive the best solution of a genetic algorithm run is the following syntax correct?</FONT></DIV>
<DIV><FONT color=#111111></FONT>&nbsp;</DIV><FONT color=#0000bf size=2>
<DIV>genome1 = ga1.statistics().bestIndividual();</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#bf005f>I am really&nbsp;very thankful if someone help me,</FONT></DIV>
<DIV><FONT color=#bf005f>Best Regards</FONT></DIV></FONT></FONT></FONT></FONT></FONT></td></tr></table><br>