コード例 #1
0
        public void Train(int numberOfHands)
        {
            for (int i = 0; i < numberOfHands; i++)
            {
                dealer.DealHoleCards(players);
                // deal board at the beginning of each hand already for training
                var board = new List <Card>();
                dealer.DealFlop(board);
                dealer.DealTurn(board);
                dealer.DealRiver(board);

                StartHandBucket startHandBucket1 = StartHandAbstracter.MapToBucket(dummyPlayer1.HoleCards[0], dummyPlayer1.HoleCards[1]);
                StartHandBucket startHandBucket2 = StartHandAbstracter.MapToBucket(dummyPlayer2.HoleCards[0], dummyPlayer2.HoleCards[1]);
                var             handBuckets      = new List <byte>()
                {
                    (byte)startHandBucket1, (byte)startHandBucket2
                }.ToArray();
                var initialState = new HeadsUpGameState()
                {
                    Phase            = GamePhase.PreFlop,
                    Board            = board,
                    Player1HoleCards = dummyPlayer1.HoleCards,
                    Player2HoleCards = dummyPlayer2.HoleCards,
                    PotSize          = HeadsupGame.BigBlindSize + HeadsupGame.SmallBlindSize,
                    AmountToCall     = HeadsupGame.SmallBlindSize
                };

                CalculateCounterFactualRegret(initialState, handBuckets, new List <ActionBucket>(), 1, 1);
            }
        }
コード例 #2
0
        public void StartNextPhase(GamePhase phase, out List <ActionType> possibleActions, out int firstAmountToCall)
        {
            possibleActions = new List <ActionType> {
                ActionType.Check, ActionType.Bet
            };
            firstAmountToCall = 0;
            switch (phase)
            {
            case GamePhase.Flop:
                dealer.DealFlop(Board);
                break;

            case GamePhase.Turn:
                dealer.DealTurn(Board);
                break;

            case GamePhase.River:
                dealer.DealRiver(Board);
                break;
            }

            onChangedPhase(this.Board, phase);
        }