Beispiel #1
0
 public static ISorter MakePhenotype(this GenomeSorterBits genomeSorterBits,
                                     IRando randy)
 {
     return(0u.CountUp(genomeSorterBits.StageBitsCount)
            .Select(i => genomeSorterBits.StageBits[i].ToSorterStage(i))
            .ToSorter(id: Guid.NewGuid(), genomeId: genomeSorterBits.Id));
 }
Beispiel #2
0
        //public static GenomeSorterBits ToGenomeSorterBits(this IEnumerable<StageBits> genomeStageDimers, Guid id)
        //{
        //    return new GenomeSorterBits(id: id, genomeStageDimers: genomeStageDimers);
        //}

        public static GenomeSorterBits Mutate(this GenomeSorterBits sorterBits, Guid id, IRando randy,
                                              double mutationRate)
        {
            return(new GenomeSorterBits(id: id,
                                        stageBits: sorterBits.StageBits.Select(sb => sb.Mutate(randy, mutationRate))));
        }