Esempio n. 1
0
        public static Dictionary <ISorter, int> ToSorterDistr(this SorterPool sorterPool)
        {
            var sd = MakeSorterDictionary();

            foreach (var sorter in sorterPool.Sorters.Values)
            {
                if (sd.ContainsKey(sorter))
                {
                    sd[sorter]++;
                }
                else
                {
                    sd.Add(sorter, 1);
                }
            }

            return(sd);
        }
Esempio n. 2
0
 public static SorterPool ToRecombo(this SorterPool sorterPool, IRando rando)
 {
     return(sorterPool.Sorters.Values.ToRandomPairs(rando)
            .SelectMany(rp => rando.Recombine(rp.Item1, rp.Item2).Split())
            .ToSorterPool());
 }