JGAP Frequently Asked Questions

[JGAP Home]


The following is a brief collection of questions and answers that come up periodically on the JGAP mailing lists. If you have suggestions for additional questions, please feel free to post them to the jgap-users mailing list!

  1. Is there a way to create a fitness function that can evaluate all of the Chromosomes in a population at once?

    Yes, a bulk fitness-function can be used. The bulk fitness function is passed all of the Chromosomes in a population at once, and then is responsible for evaluating each of those Chromosomes and setting their fitness values. This can be especially useful when you want to evaluate Chromosomes in relationship to each other (rather than in isolation of each other), or if you want to make use of an external service to actually perform the evaluation.

    For more information on bulk fitness-functions, please see the javadocs for the org.jgap.BulkFitnessFunction class.

  2. Does JGAP support real-valued fitness values or alleles?

    Yes, double typed fitness values have been introduced with release 1.1. Before that the type was int.

  3. How can I select the top n performers of a population?

    During evolution, to select the best performing chromosomes for the next generation, use the org.jgap.impl.BestChromosomesSelector. See org.jgap.impl.DefaultConfiguration for an example.

    To select the top n performers after evolution, you could use Genotype.getPopulation.toChromosomes(). After that, sort the returned array of Chromosomes via Arrays.sort(chromosomesArrayFromPopulation, yourComparator). yourComparator sorts the array of chromosomes by the fitness value of each Chromosome.

  4. Does JGAP support multiple threads?

    JGAP does not currently offer any support for multi-threaded or distributed evaluation, but this is something we're considering for a future (after version 2.0) release.

  5. I notice that sometimes the fittest chromosome doesn't get selected for the next generation. What's up with that?

    Natural selection in JGAP is statistical, so chromosomes that are more fit have a better statistical chance of being selected over chromosomes that are less fit, but it's not guaranteed. This is much like nature, where even the fittest of us can sometimes be unlucky!

    Incidentally, JGAP is designed to be very pluggable, and it's possible for you to write your own natural selector and plug it into JGAP in place of the default version, if that better suits your needs.

  6. Why aren't the chromosomes in my population ever candidates for natural selection?

    This should not happen if you properly use a NaturalSelector resp. if this selector is implemented correctly. The reproduction operator is deprecated in newer JGAP versions due to performance reasons and due to the fact that the current architecture delivers such functionality itself.

    Has anyone used JGAP in combination with the JOONE neural networks package?

    Yes, as a matter of a fact there is a whole open-source project dedicated to integration of JGAP with JOONE! You can find out more about the JOONEGAP project on their homepage.

    Additionally (among others), there is a dissertation about Genetic Algorithms playing together with Neural Nets to play Backgammon!


[JGAP Home]
SourceForge Logo