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); }
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()); }