Beispiel #1
0
        public static bool CheckMerge(LargeCombo large1, LargeCombo large2, int flag)
        {
            if (large1.ComboCards.Count + large2.ComboCards.Count > 30)
            {
                return(false);
            }
            if (large1.ComboClass != "NEUTRAL" && large2.ComboClass != "NEUTRAL" &&
                large1.ComboClass != large2.ComboClass)
            {
                return(false);
            }
            if (HasIllegalDuplicate(large1, large2))
            {
                return(false);
            }
            double p = new DynamicVectorCalculator().RandomWeightCalcualte(large1, large2, flag);

            ////????
            if (rand.NextDouble() > p)
            {
                Console.WriteLine("ref, p = " + p.ToString());
                return(false);
            }
            return(true);
        }
        public bool CheckMerge(LargeCombo large1, LargeCombo large2, DNA dna)
        {
            if (large1.ComboCards.Count + large2.ComboCards.Count > 30)
            {
                return(false);
            }
            if (large1.ComboClass != "NEUTRAL" && large2.ComboClass != "NEUTRAL" &&
                large1.ComboClass != large2.ComboClass)
            {
                return(false);
            }
            if (HasIllegalDuplicate(large1, large2))
            {
                return(false);
            }
            double p = new DynamicVectorCalculator().CalculateByEvolution(large1, large2, dna);

            if (rand.NextDouble() > p)
            {
                //Console.WriteLine("ref, p = " + p.ToString());
                return(false);
            }
            return(true);
        }