示例#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);
        }