<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 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> GARealGenome genome(33,alleles,Objective,(void*)chrom1);</P>
<P> genome.initializer(GARealGenome::UniformInitializer);<BR> genome.mutator(GARealGenome::FlipMutator);<BR> genome.crossover(GARealGenome::OnePointCrossover);</P>
<P> GASimpleGA ga(genome);<BR> ga.populationSize(14);<BR> ga.nGenerations(14);<BR> ga.pMutation(0.9);<BR> ga.pCrossover(0.9);<BR> ga.evolve();</P>
<DIV>The code of the objective function is </DIV>
<DIV> </DIV>
<DIV>float Objective(GAGenome& g)<BR>{<BR> GA1DArrayGenome & genome=(GA1DArrayGenome &)g;<BR> float score=0.0;<BR> float* currentgenome=(float*)((GAGenome&)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> score=getScore(currentgenome); // getScore function calculated the score of the genome</DIV>
<DIV> 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> </DIV>
<DIV>Naveed Ahmad</DIV>
<DIV>FAST NUCES</DIV>
<DIV>Lahore</DIV>
<DIV> </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>