by kraada » Tue Aug 25, 2009 5:52 pm
The actions string is going to be important, you are correct. B is bet, meaning the first betting action anybody took on the street. C is call, R is raise, F is fold and X is check.
I am going to presume also for the sake of simplicity we are filtering to deal with hands that we are heads up with someone else on the river. Multiway pots get awfully complicated. That will be achieved by adding "AND holdem_hand_summary.cnt_players_r = 2" to the initial if statement.
So we need to deal with several cases:
(1) Cases where the final pot is the pot on the river. This happens when:
(a) The river is checked through. This is easy: lookup_actions_r = 'X'.
(b) Everyone was all-in before the river. This is not too bad either: lookup_actions_r = '', as the only way there can be two people on the river and you not have an action is if you were both all in prior to the river.
(c) We make a bet and everyone folds. This is: lookup_actions_r = 'B' AND NOT(flg_showdown). As of course our bet is not added to the pot when it is not called.
(d) We faced a bet and folded. This is: lookup_actions_r = 'F'.
(2) Cases where the final pot minus a bet is the pot on the river. This happens when:
(a) We bet and get called. This is: lookup_actions_r = 'B' AND flg_showdown. The pot on the river is then amt_pot - 2 * amt_r_bet_made (remember we bet and there was a call :).
(b) We face a bet and call. This is: lookup_actions_r = 'C' AND flg_showdown. The pot on the river is then amt_pot - 2 * amt_r_bet_facing.
(c) We raise a bet and our opponent folds. This is: lookup_actions_r = 'R' AND NOT(flg_showdown). The pot on the river is then amt_pot - 2 * amt_r_bet_facing.
(d) Our opponent raises our bet and we fold. This is: lookup_actions_r = 'B' and NOT(flg_showdown). The pot on the river is then amt_pot - 2 * amt_r_bet_made.
(3) Cases where we get all-in on the river:
(a) This occurs when enum_allin = 'R' and the pot at the start of the river is amt_pot - amt_r_effective_stack.
(4) Cases where there are raises:
(a) We raise directly and are called: lookup_actions_r = 'R' and flg_showdown. The pot on the river is then amt_pot - 2 * amt_r_raise_made.
(b) We bet and call a raise. lookup_actions_r = 'BC' and flg_showdown. The pot on the river is then amt_pot - 2 * amt_r_raise_facing.
(c) We 3-bet and our opponent folds: flg_r_3bet and not(flg_showdown) and not(flg_r_4bet_def_opp). The pot on the river is then amt_pot - 2 *amt_r_raise_facing.
(d) Our opponent 3-bets and we fold: flg_r_3bet_def_opp and not(flg_showdown) and not(flg_r_4bet_def_opp). The pot on the river is then amt_pot - 2 * amt_r_raise_made.
I can't imagine a spot where someone 3bet/folds on the river, but you should be able to figure that out if you'd like to add that in as well.
Then you basically build a big nested if[] statement testing for all of these cases. You can see why it's awfully tedious (and going back to the turn pot size is even worse!)