Mutation, Crossover not working on GARealGenome

Markku Laukkanen markku at ailabsolutions.com
Thu Apr 18 03:14:20 EDT 2002


> float Objective(GAGenome& g)
> {
> GA1DArrayGenome & genome=(GA1DArrayGenome &)g;
> float score=0.0;
> float* currentgenome=(float*)((GAGenome&)genome).userData();
> *****************************
> /*HERE IS THE PROBLEM PROBLEM*/
> /*We ALWAYS GET THE SAME currentgenome.....HOW IS IT POSSIBLE IF MUTATION 
> AND CROSSOVER ARE WORKING*/
> *****************************
> score=getScore(currentgenome);       // getScore function calculated the 
> score of the genome
>   return score;
> }

userData function always returns the same value for all genes. This is a
pointer into user defined data, which the user wants to use with the
genome (e.g. pointer into this object of the implementation of the
problem solver);

You have to use the genome.gene(x) functions to retrieve the right data..

	PKY


> 
> We have to submit the project soon....so we would be very thankful if you 
> reply soon...
> 
> Naveed Ahmad
> FAST NUCES
> Lahore
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://lancet.mit.edu/mailman/listinfo/galib
> 




More information about the galib mailing list