BackgroundWorker.raceRange

BackgroundWorker.raceRange(combo: Array<string>, total: Number, trackCombos: Boolean?, board: Array<string>?): Number
Parameters
combo (Array<string>) to race i.e. [ 'As', 'Ad' ]
total (Number) the total number of times to race, 100 are processed each time and update invoked until the total is reached
trackCombos (Boolean? = false) if true the counts for each combos are tracked
board (Array<string>? = null) if supplied the range will be raced against subsets boards that include all cards of the given board
Returns
Number: the uid generated to identify this background job, the same uid will be included in the message the result to identify it with the job

BackgroundWorker.stop

Stops any races in progress.

BackgroundWorker.stop()

createBackgroundWorker

Creates a background worker which uses a web worker under the hood to process race requests.

createBackgroundWorker(update: funcion): BackgroundWorker
Parameters
update (funcion) will be called with updates: { win, loose, tie, iterations, uid }
Returns
BackgroundWorker: backgroundWorker

raceCodesForBoard

Same as @see raceCombosForBoard, except that the combo cards are given as their codes obtained via phe cardCodes.

raceCodesForBoard(combo1: any, combo2: any, times: any, board: any)
Parameters
combo1 (any)
combo2 (any)
times (any)
board (any)

raceCodes

Same as @see raceCombos, except that the combo cards are given as their codes obtained via phe cardCodes.

raceCodes(combo1: any, combo2: any, times: any)
Parameters
combo1 (any)
combo2 (any)
times (any)

raceRangeCodesForBoard

Same as @see raceRangeForBoard, except that the combo, range cards and board are given as their codes obtained via phe cardCodes.

raceRangeCodesForBoard(comboCodes: any, rangeCodes: any, times: any, trackCombos: any, boardCodes: any)
Parameters
comboCodes (any)
rangeCodes (any)
times (any)
trackCombos (any)
boardCodes (any)

raceRangeCodes

Same as @see raceRange, except that the combo and range cards are given as their codes obtained via phe cardCodes.

raceRangeCodes(combo1: any, range: any, times: any, trackCombos: any)
Parameters
combo1 (any)
range (any)
times (any)
trackCombos (any)

raceCombosForBoard

Races two combos against each other.

raceCombosForBoard(combo1: Array<string>, combo2: Array<string>, times: Number?, board: Array<string>?): any
Parameters
combo1 (Array<string>) first combo to race i.e. [ 'As', 'Ad' ]
combo2 (Array<string>) second combo to race i.e. [ 'As', 'Ad' ]
times (Number? = null) the number of times to race, if not supplied combos are races against all possible boards
board (Array<string>? = null) omit for preflop, but provide for postflop to race against boards that just add a turn or river card to the given one
Returns
any: count of how many times combo1 wins, looses or ties, i.e. { win, loose, tie }

raceCombos

Races two combos against each other.

raceCombos(combo1: Array<string>, combo2: Array<string>, times: Number?): any
Parameters
combo1 (Array<string>) first combo to race i.e. [ 'As', 'Ad' ]
combo2 (Array<string>) second combo to race i.e. [ 'As', 'Ad' ]
times (Number? = null) the number of times to race, if not supplied combos are races against all possible boards
Returns
any: count of how many times combo1 wins, looses or ties, i.e. { win, loose, tie }

raceRangeForBoard

Race the given combo vs. the given combo to count number of wins, losses and ties. The boards created for the race will include all cards of the given board.

raceRangeForBoard(combo: Array<string>, range: Array<Array<string>>, times: Number?, trackCombos: Boolean?, board: Array<string>?): any
Parameters
combo (Array<string>) to race i.e. [ 'As', 'Ad' ]
range (Array<Array<string>>) multiple combos to raise against it, i.e. [ [ 'Ks', 'Kd' ], [ 'Qs', 'Qd' ] ]
times (Number? = null) the number of times to race, if not supplied combos are races against all possible boards
trackCombos (Boolean? = false) if true the counts for each combos are tracked
board (Array<string>? = null) omit for preflop, but provide for postflop to race against boards that just add a turn or river card to the given one
Returns
any: count of how many times the combo wins, looses or ties, i.e. { win, loose, tie }

raceRange

Race the given combo vs. the given combo to count number of wins, losses and ties.

raceRange(combo: Array<string>, range: Array<Array<string>>, times: Number?, trackCombos: Boolean?): any
Parameters
combo (Array<string>) to race i.e. [ 'As', 'Ad' ]
range (Array<Array<string>>) multiple combos to raise against it, i.e. [ [ 'Ks', 'Kd' ], [ 'Qs', 'Qd' ] ]
times (Number? = null) the number of times to race, if not supplied combos are races against all possible boards
trackCombos (Boolean? = false) if true the counts for each combos are tracked
Returns
any: count of how many times the combo wins, looses or ties, i.e. { win, loose, tie }

rates

Given win, loose and tie count it converts those to winning rates in percent.

rates($0: Object): Object
Parameters
$0 (Object)
Name Description
$0.win Number number of wins
$0.loose Number number of losses
$0.tie Number number of ties
$0.combos Map<String, Number>? (default null) map of counts per combo, if given their rates are calculated as well
Returns
Object: win rates `{ winRate, looseRate, tieRate, combos? }