private void catchUpActionsFromServer(Dictionary <Street, List <MatchState.ActionInfo> > newBetting, HoleCards heroHoleCards) { Street street = _botGameState.getStreet(); int prevNumActions = (_prevMatchState.betting.ContainsKey(street)) ? _prevMatchState.betting[street].Count : 0; int nextNumActions = (newBetting.ContainsKey(street)) ? newBetting[street].Count : 0; // CatchUp with the actions... for (int i = prevNumActions; i < nextNumActions; i++) { var action = newBetting[street][i]; var playerToActName = _botGameState.getPlayerToAct().Name; var byAmmount = action.Amount - _botGameState.getPlayerToAct().MoneyInPot; _botGameState.playerActs(action.Type, byAmmount); var heroGuess = hero().Range.getHoleCardsProb(_prevMatchState.heroHoleCards()) * 100; Console.Write("Server says: " + playerToActName + " " + action.Type.ToString() + "s"); if (playerToActName == "Hero") { Console.Write(" [Hole Cards Guess: " + heroGuess.ToString("f1") + "%]"); } if (action.Amount > 0) { Console.WriteLine(" to " + action.Amount.ToString()); } else { Console.WriteLine(""); } } }
void IActionEstimator.newAction(ActionType actionType, BotGameState gameState) { float betRaiseProb = 0.0f; float checkCallProb = 0.0f; getPlayerToActAD(ref betRaiseProb, ref checkCallProb, gameState); gameState.getPlayerToAct().CutRange(actionType, gameState.getStreet(), gameState.getBoard(), betRaiseProb, checkCallProb, _dmContext); }
private void getPlayerToActAD(ref float betRaiseProb, ref float checkCallProb, BotGameState gameState) { var playerToAct = gameState.getPlayerToAct(); EstimatedAD ad = getPlayerToActAD(playerToAct, gameState); Debug.Assert(ad.PriorSamples > 0); betRaiseProb = ad.BetRaise.Mean; checkCallProb = ad.CheckCall.Mean; if (!canNextPlayerRaise(playerToAct, gameState)) { checkCallProb += betRaiseProb; betRaiseProb = 0.0f; } Console.WriteLine($"{playerToAct.Name} model stats: BR {betRaiseProb.ToString("f2")}; CC {checkCallProb.ToString("f2")};" + $" FO {(1 - betRaiseProb - checkCallProb).ToString("f2")} [prior smpls:{ad.PriorSamples}, updates:{ad.UpdateSamples}]"); }