super(playerId, tableId, lobby, buyIn, executor, botListeners);
}
@Override
public void doNextAction() {
GameState gameState = playerContext.getGameState();
int deficit = gameState.getDeficit(HandBot.this.botId);
int nbPlayers = 0;
for(PlayerState p: gameState.getAllSeatedPlayers()){
if(p.isActivelyPlaying()) nbPlayers++;
}
double winPercentage = getWinPercentage(gameState
.getCommunityCards(), playerContext.getPocketCards(),
100, nbPlayers - 1);
if (logger.isDebugEnabled()) {
logger.debug("Win percentage is " + winPercentage
+ " with " + playerContext.getPocketCards()
+ " and " + gameState.getCommunityCards() + " and "
+ (nbPlayers - 1) + " opponents.");
}
double EV = winPercentage
* (gameState.getGamePotSize() + deficit);
if (gameState.getRound().equals(Round.PREFLOP)) {
// be more aggressive on the flop
EV += EV;
}
try {
if (gameState
.getNextActivePlayerAfter(HandBot.this.botId) == null) {
// can only call or fold
if (deficit <= Math.round(EV)) {
playerContext.checkOrCall();
} else {