예제 #1
0
        public Species(ref Genome genome)
        {
            this.instanceID = Guid.NewGuid();

            this.genomes = new List <Genome>();

            this.candidate = genome;
            genome.setSpecies(this);
        }
예제 #2
0
        // Assign an appropriate Genome to a Species
        // or create a new Species
        private Species assignSpecies(ref Genome genome)
        {
            foreach (Species existing in this.species)
            {
                if (existing.isCompatible(ref genome))
                {
                    genome.setSpecies(existing);
                    return(existing);
                }
            }

            Species ge = new Species(ref genome);

            this.species.Add(ge);

            return(ge);
        }