Skip to main content

decideActionWithDiagnostics

Run native decision logic and include legal-action and EV diagnostics.

decideActionWithDiagnostics(state: NativePokerState | PokerStateBytes, config: NativeBotConfig, opponentModel?: NativeOpponentModel | null, heroSeat?: number): DecisionDiagnosticResult

Import

const poker = require('poker-calculations');

ESM (Node):

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const poker = require('poker-calculations');

When to use

Use decideActionWithDiagnostics when you need to run native decision logic and include legal-action and EV diagnostics.

How to use

const poker = require('poker-calculations');
const state = {
players: [
{holeCards: ['Ah', 'Kh'], stack: 200, seat: 0, committedThisStreet: 0},
{holeCards: ['7c', '7d'], stack: 180, seat: 1, folded: false},
],
communityCards: ['Qh', 'Jh', '2c'],
phase: 'flop',
pot: 30,
currentBet: 10,
smallBlind: 1,
bigBlind: 2,
actingIndex: 0,
actedThisStreet: [false, true],
};

const result = poker.decideActionWithDiagnostics(state, {monteCarloSimulations: 0});
console.log(result);

See also

decideAction · NativePokerState