public Species(ref Genome genome) { this.instanceID = Guid.NewGuid(); this.genomes = new List <Genome>(); this.candidate = genome; genome.setSpecies(this); }
// 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); }