Beispiel #1
0
        public static GaData ToStageDimerGaData(
            this IRando randy, uint order,
            uint sorterCount, uint sortableCount, uint stageCount,
            double sorterWinRate, double sortableWinRate)
        {
            var randomSortablePool = randy.ToRandomSortablePool(order, sortableCount);
            var dimerGenomePool    = randy.ToGenomePoolStageDimer(order, stageCount, sorterCount);

            var d = new Dictionary <string, object>();

            d.SetCurrentStep(0);
            d.SetSeed(randy.NextInt());
            d.SetSorterWinRate(sorterWinRate);
            d.SetSortableWinRate(sortableWinRate);
            d.SetSortablePool(randomSortablePool);
            d.SetDimerGenomePool(dimerGenomePool);

            return(new GaData(d));
        }
Beispiel #2
0
        public static GaData ToDirectGaSortingData(
            this IRando randy, uint order,
            uint sorterCount, uint sortableCount, uint stageCount,
            double sorterWinRate, double sortableWinRate,
            StageReplacementMode stageReplacementMode)
        {
            var randomSortablePool = randy.ToRandomSortablePool(order, sortableCount);
            var randomSorterPool   = randy.ToRandomSorterPool(order, stageCount, sorterCount);

            var d = new Dictionary <string, object>();

            d.SetCurrentStep(0);
            d.SetSeed(randy.NextInt());
            d.SetSorterWinRate(sorterWinRate);
            d.SetSortableWinRate(sortableWinRate);
            d.SetSortablePool(randomSortablePool);
            d.SetSorterPool(randomSorterPool);
            d.SetStageReplacementMode(stageReplacementMode);

            return(new GaData(d));
        }