[mlpack-git] [mlpack/mlpack] Neural evolution algorithms implementation (CNE, NEAT, HyperNEAT) (#686)
Excalibur
notifications at github.com
Sat Jul 16 01:01:24 EDT 2016
> + }
> +
> + // Add genome to existing species or create new species.
> + void AddGenomeToSpecies(Population& population, Genome& genome) {
> + for (ssize_t i=0; i<population.aSpecies.size(); ++i) {
> + if (population.aSpecies[i].aGenomes.size() > 0) {
> + if (IsSameSpecies(population.aSpecies[i].aGenomes[0], genome)) { // each first genome in species is the representative genome.
> + population.aSpecies[i].AddGenome(genome);
> + return;
> + }
> + }
> + }
> +
> + Species newSpecies = Species();
> + newSpecies.AddGenome(genome);
> + newSpecies.Id(population.NextSpeciesId()); // NOTICE: changed species id.
Good point! revised.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/686/files/ff45785b8669f82beb38ef5392f48bcdf5c83f6a#r71061137
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160715/3e4b114d/attachment.html>
More information about the mlpack-git
mailing list