Skip to main content

Monte Carlo equity

Card lists accept CardInput (string[] or packed Uint8Array) — see Packed card input.

See Batch equity for packed batch layouts.

Cancellation

All six *Async exports in this area (and decideActionAsync, benchmarkEvaluatorThroughputAsync) accept an optional trailing AsyncOptions object with signal?: AbortSignal. Aborting rejects the Promise with AbortError and stops cooperative work in the native layer.

const ac = new AbortController();
const pending = poker.simulateHandOutcomeAsync(hole, board, 2_000_000, 42, 1, {
signal: ac.signal,
});
await new Promise((r) => setImmediate(r));
ac.abort();

Use a fixed seed for reproducible research; increase numSimulations until monteCarloStandardError is acceptable.