<html><div style='background-color:'><DIV>Dear all, </DIV>i have already posted one message, got one reply but could not solve my problem. 
<DIV></DIV>
<P>The problem is that the population does not change, i.e., i think the cross over and mutation operator are not&nbsp;working. I am using  GARealGenome to code the genome. I caught the problem in Objective function.Here is the code.</P>
<P>GARealAlleleSet alleles(-10,10);</P>
<P>&nbsp; GARealGenome&nbsp; genome(33,alleles,Objective,(void*)chrom1);</P>
<P>&nbsp; genome.initializer(GARealGenome::UniformInitializer);<BR>&nbsp; genome.mutator(GARealGenome::FlipMutator);<BR>&nbsp; genome.crossover(GARealGenome::OnePointCrossover);</P>
<P>&nbsp; GASimpleGA ga(genome);<BR>&nbsp; ga.populationSize(14);<BR>&nbsp; ga.nGenerations(14);<BR>&nbsp; ga.pMutation(0.9);<BR>&nbsp; ga.pCrossover(0.9);<BR>&nbsp; ga.evolve();</P>
<DIV>The code of the objective function is </DIV>
<DIV>&nbsp;</DIV>
<DIV>float Objective(GAGenome&amp; g)<BR>{<BR>&nbsp;GA1DArrayGenome &amp; genome=(GA1DArrayGenome &amp;)g;<BR>&nbsp;float score=0.0;<BR>&nbsp;float* currentgenome=(float*)((GAGenome&amp;)genome).userData();</DIV>
<DIV>*****************************</DIV>
<DIV>/*HERE IS THE PROBLEM PROBLEM*/</DIV>
<DIV>/*We ALWAYS GET THE SAME currentgenome.....HOW IS IT POSSIBLE IF MUTATION AND CROSSOVER ARE WORKING*/</DIV>
<DIV>*****************************<BR>&nbsp;score=getScore(currentgenome);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// getScore function calculated the score of the genome</DIV>
<DIV>&nbsp;&nbsp;return score;<BR>}<BR></DIV>
<DIV>We have to submit the project soon....so we would be very thankful if you reply soon...</DIV>
<DIV>&nbsp;</DIV>
<DIV>Naveed Ahmad</DIV>
<DIV>FAST NUCES</DIV>
<DIV>Lahore</DIV>
<DIV>&nbsp;</DIV></div><br clear=all><hr>Send and receive Hotmail on your mobile device: <a href='http://g.msn.com/1HM200901/2W'>Click Here</a><br></html>