[jgap-users] Problems using the bulk fitness function facility
Brought to you by:
klausikm
From: David K. <da...@li...> - 2009-09-26 04:35:31
|
For my particular problem, I need access to the whole population before I can determine the fitness of an individual, and so I thought that the easiest approach would be to implement a BulkFitnessFunction. I had trouble getting it working, did some debugging, and decided that either I have misunderstood the intention behind BulkFitnessFunction, or there is a bug in GABreeder. After a quick search of this users mailing list, I saw that I am not the only one (See: Mike Lechner <mike.lechner@gm...>, July 22, 2009, BulkFitFn doesn't mutate or breed?). This thread did not seem to come to a resolution. Attached is the simpest example that I could think of. So simple that it does not actually need to use a bulk fitness function, but it shows the problem. The population consists of two individuals, with one integer gene each, and a bulk fitness function that simply uses the value of the gene as its fitness value. If you run it as it is, the two individuals at the end of the 100 iterations are the same as the two you start with. If you uncomment the line where I set the breeder to be my breeder then, unless you are really unlucky, at least one of the individuals should have been replaced with a "fitter" one at some stage during the 100 iterations. Cheers, David Kemp |