コード例 #1
0
        private void calcRaiserRange()
        {
            int[,] callPercentages = { { 25,  0,  0 },   // heads-up
                                       { 16, 12,  0 },   // three left
                                       { 14, 12, 10 } }; // bubble

            Console.WriteLine("HALY!! numOfPlayers: " + numOfPlayers + " raiserPos: " + raiserPos);
            int callPercent = callPercentages[numOfPlayers - 2, raiserPos - 1];

            Console.WriteLine("vastustajien call Percent: " + callPercent);

            int myIndex   = position;
            int myPercent = 1;

            for (myPercent = 1; myPercent < 60; myPercent += 2)
            {
                // alustetaan resetPlayersData, asetetaan stäkit ja maksetut blindit
                resetPlayersData();
                for (int a = 0; a < numOfPlayers; a++)
                {
                    playersData[a, 0] = stacks[a];
                }
                playersData[0, 1] = BBsize;
                playersData[1, 1] = BBsize / 2;

                // vastustajien call ranget
                for (int a = 0; a < myIndex; a++)
                {
                    playersData[a, 2] = callPercent;
                }

                if (icm.calcPush(numOfPlayers, icm.handIndexToHand(myPercent), myIndex, playersData, ICMs, ICMc) < 0)
                {
                    break;
                }
            }

            // pienennetään rangea satunnaisesti hieman
            if (myPercent == 61)
            {
                raiserRange = random.Next(20, myPercent);
            }
            else if (raiserRange > 20)
            {
                raiserRange -= random.Next(5, 10);
            }
            else
            {
                raiserRange = myPercent;
            }
        }
コード例 #2
0
ファイル: calcRanges.cs プロジェクト: grondman/SNGEGT
        private void calcPushRange()
        {
            int    myIndex  = 1; // SB
            int    oppIndex = 0; // BB
            int    range    = 1;
            double EV       = 0;

            // betit
            playersData[myIndex, 1]  = BB / 2;
            playersData[oppIndex, 1] = BB;

            // ranget
            playersData[myIndex, 2]  = 0;
            playersData[oppIndex, 2] = callerRange;

            // etsitään ensimmäinen positiivinen push range
            for (range = 100; range > 0; range--)
            {
                //icm.handIndexToRandomHand(range, myHand);
                myHand = icm.handIndexToHand(range);
                EV     = icm.calcPush(2, myHand, myIndex, playersData, ICMs, ICMc);

                //Console.WriteLine("calcPushRange! Hand: " + icm.handToStr(myHand) + " EV: " + EV);

                if (EV > THRESHOLD)
                {
                    break;
                }
            }

            //Console.WriteLine(playersData[0, 0] + " " + playersData[1, 0]);
            //Console.WriteLine("Ensimmainen positiivinen push range on " + range);
            //Console.WriteLine("Hand: " + icm.handToStr(myHand) + " EV: " + EV);
            raiserRange = range;
        }
コード例 #3
0
ファイル: calcRanges.cs プロジェクト: grondman/SNGEGT
        // We are doing first PUSH
        private int calcPushRange(int myIndex)
        {
            double[] EVs   = { 0, 0, 0 };
            int      range = 0;

            EVs[1] = icm.calcPush(players, icm.handIndexToHand(1), myIndex, playersData, payoutStructure, payoutStructure.Length);
            EVs[2] = icm.calcPush(players, icm.handIndexToHand(2), myIndex, playersData, payoutStructure, payoutStructure.Length);
            for (range = 3; range <= 100; range++)
            {
                EVs[0] = EVs[1];
                EVs[1] = EVs[2];
                EVs[2] = icm.calcPush(players, icm.handIndexToHand(range), myIndex, playersData, payoutStructure, payoutStructure.Length);

                if ((EVs[0] + EVs[1] + EVs[2]) / 3 < EVthreshold)
                {
                    break;
                }
            }

            return(range - 1);
        }
コード例 #4
0
ファイル: Game.cs プロジェクト: grondman/SNGEGT
        // radioButtonPush.Checked, comboBoxPlayers.SelectedIndex + 2, comboBoxHand.SelectedIndex, ICMs, ICMc
        public double calcICM(bool mode)
        {
            results = new double[] { 0, 0 };

            // push
            if (mode == true)
            {
                //System.Windows.Forms.MessageBox.Show("playersCount: " + Convert.ToString(playersCount) + " " + "handIndex: " + Convert.ToString(handIndex) + " " + "myIndex: " + Convert.ToString(myIndex()));
                icm.calcPush(playersCount, handIndex, myIndex(), playersData, results, ICMs, ICMs.Length);
            }

            // call
            if (mode == false)
            {
                icm.calcCall(playersCount, handIndex, myIndex(), allinIndex(), playersData, results, ICMs, ICMs.Length);
            }

            return(results[1] * 100 - results[0] * 100);
        }