Skip to content

Commit

Permalink
Add support for bets EV
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurab1 committed Jan 30, 2024
1 parent f8aeafa commit 29fdb1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions scrimmage/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def _get_bids(game_log, player_name):
if matches == []: return 0
return sum(map(int, matches))/len(matches)

def _get_bet_evs(game_log, player_name, street_name):
matches = re.search(rf'{player_name} {street_name} bets EV: ([\-0-9]+)', game_log)
if matches is None: return 0
return int(matches.group(1))

def _get_winner(bot_a_score, bot_b_score):
if bot_a_score == bot_b_score:
Expand Down Expand Up @@ -361,6 +365,10 @@ def arbitrary_tournament_data_collection_function(gamelog):
"B_bid_W": gamelog.count("B won the auction"),
"A_W_bid_L": A_win_auction_loss,
"B_W_bid_L": B_win_auction_loss,
"ev_A_flop": _get_bet_evs(gamelog, "A", "flop"),
"ev_B_flop": _get_bet_evs(gamelog, "B", "flop"),
"ev_A_turn": _get_bet_evs(gamelog, "A", "turn"),
"ev_B_turn": _get_bet_evs(gamelog, "B", "turn")
}


Expand Down

0 comments on commit 29fdb1d

Please sign in to comment.