Beispiel #1
0
        public void update_measure(GenomeList p)
        {
            GenomeList total = new GenomeList();

            total.AddRange(p);
            total.AddRange(measure_against);
            total.AddRange(archive);

            merge_together(total, p.Count);
            Console.WriteLine("size: " + Convert.ToString(measure_against.Count));
        }
Beispiel #2
0
        /// <summary>
        /// Creates a genomeList from a random start, or using a list of seed genome IDs
        /// </summary>
        /// <param name="popSize"></param>
        /// <param name="parentGenomeIDs"></param>
        /// <returns></returns>
        public GenomeList createGenomeList(int popSize, AssessGenotypeFunction genoAssess, List <long> parentGenomeIDs = null)
        {
            //must return a genome list!
            GenomeList gl;

            //if we have parents, add their genomes to our starting genomelist
            if (parentGenomeIDs != null)
            {
                GenomeList seeds = new GenomeList(); seeds.AddRange(getGenomesFromIDs(parentGenomeIDs).Values);
                gl = new GenomeList();
                gl.AddRange(GenomeFactory.CreateGenomeListPreserveIDs(seeds, popSize, neatParams, idgen, genoAssess));
            }
            else
            {
                //we don't have any seeds, we need to form our own initial population
                gl = GenomeFactory.CreateGenomeListPreserveIDs(neatParams, idgen,
                                                               cppnInputs, cppnOutputs, neatParams.pInitialPopulationInterconnections, popSize,
                                                               genoAssess);
            }

            //add each genome to our list of generated genomes, yo.
            //gl.ForEach(genome => allGeneratedGenomes.Add(genome));

            //now we are free to return the genomes
            return(gl);
        }
Beispiel #3
0
 /// <summary>
 /// Transfer genomes from GenomeById into GenomeList.
 /// </summary>
 public void FlushWorkingDictionary()
 {
     GenomeList.Clear();
     GenomeList.AddRange(GenomeById.Values);
     GenomeById.Clear();
 }
Beispiel #4
0
        /// <summary>
        /// Creates a genomeList from a random start, or using a list of seed genome IDs
        /// </summary>
        /// <param name="popSize"></param>
        /// <param name="parentGenomeIDs"></param>
        /// <returns></returns>
        public GenomeList createGenomeList(int popSize, AssessGenotypeFunction genoAssess, List<long> parentGenomeIDs = null)
        {
            //must return a genome list!
            GenomeList gl;

            //if we have parents, add their genomes to our starting genomelist
            if (parentGenomeIDs != null)
            {
                GenomeList seeds = new GenomeList(); seeds.AddRange(getGenomesFromIDs(parentGenomeIDs).Values);
                gl = new GenomeList();
                gl.AddRange(GenomeFactory.CreateGenomeListPreserveIDs(seeds, popSize, neatParams, idgen, genoAssess));
            }
            else
            {
                //we don't have any seeds, we need to form our own initial population
                gl = GenomeFactory.CreateGenomeListPreserveIDs(neatParams, idgen,
                    cppnInputs, cppnOutputs, neatParams.pInitialPopulationInterconnections, popSize,
                    genoAssess);
            }

            //add each genome to our list of generated genomes, yo.
            //gl.ForEach(genome => allGeneratedGenomes.Add(genome));

            //now we are free to return the genomes
            return gl;
        }