Esempio n. 1
0
        public void QualityQuickTest()
        {
            var cards       = "2S KH 3H";
            var hands       = "6H TD";
            var playerCards = CardsBuilder.BuildCardsFromString(hands).ToList();

            var cardslist = CardsBuilder.BuildCardsFromString(cards).ToList();

            var playerHand = new PlayerHand(playerCards[0], playerCards[1]);

            var quality = _qualityEvaluator.EvalQualityScore(playerHand, new List <Card>());
        }
Esempio n. 2
0
        public override PlayerAction Play(IList <PlayerAction> actions)
        {
            try
            {
                var totalPlayerInvestedInPots = Table.CurrentGame.Pots
                                                .Where(pot => pot.Participants.Contains(Player))
                                                .Sum(pot => pot.Amount / pot.Participants.Count);

                var winableAmount = Table.CurrentGame.Pots
                                    .Where(pot => pot.Participants.Contains(Player))
                                    .Sum(pot => pot.Amount);

                var maxBid = Table.Players.Max(player => player.Bid);

                var quality = _qualityEvaluator.EvalQualityScore(Player.Hand, Table.CurrentGame.Cards.Cards.ToList());

                var cashCriticality = _cashCriticalityEvaluator.EvaluateCashCriticality(Player.Cash, Player.Bid, maxBid, totalPlayerInvestedInPots, winableAmount);

                //Console.WriteLine($"quality {quality} , critic {cashCriticality}");

                var action = _decisionEvaluator.Decide(actions, quality, cashCriticality, _useEllipse, _areas);
                //if (Player.Name == "Ratchet") Console.WriteLine($"{Player.Name}: {action.State}");
                return(action);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Esempio n. 3
0
        public override PlayerAction Play(IList <PlayerAction> actions)
        {
            try
            {
                var totalPlayerInvestedInPots = Table.CurrentGame.Pots
                                                .Where(pot => pot.Participants.Contains(Player))
                                                .Sum(pot => pot.Amount / pot.Participants.Count);

                var winableAmount = Table.CurrentGame.Pots
                                    .Where(pot => pot.Participants.Contains(Player))
                                    .Sum(pot => pot.Amount);

                var maxBid = Table.Players.Max(player => player.Bid);

                var quality = _qualityEvaluator.EvalQualityScore(Player.Hand, Table.CurrentGame.Cards.Cards.ToList());

                var cashCriticality = _cashCriticalityEvaluator.EvaluateCashCriticality(Player.Cash, Player.Bid, maxBid, totalPlayerInvestedInPots, winableAmount);

                var         agressivity = _agressivityEvaluator.EvaluateAggressivity(Table.Players.Where(p => p != Player).ToList());
                TableResult iaToUse     = _ias[1];
                //Console.WriteLine(agressivity);
                if (agressivity > 0.3)
                {
                    iaToUse = _ias[1];
                }
                else
                {
                    iaToUse = _ias[0];
                }

                //Console.WriteLine(agressivity);


                var action = _decisionEvaluator.Decide(actions, quality, cashCriticality, true, iaToUse.EllipticAreas);
                return(action);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }