Skip to content

Commit

Permalink
added a little bit of trapping with lock hands
Browse files Browse the repository at this point in the history
  • Loading branch information
gnmerritt committed Apr 26, 2015
1 parent ceac1ce commit 8b38aed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pokeher/brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ def pick_action(self, equity, pot_odds):

# action to us: check or bet
if to_call == 0:
if equity > 65 or (equity > 40 and self.r_test(0.03, 'c1')):
# lock hands - 1/3 of the time make a small bet instead of a big one
if equity > 90 and self.r_test(0.33, 'lock_trap'):
self.bot.bet(self.minimum_bet("trap1"))
elif equity > 65 or (equity > 40 and self.r_test(0.03, 'c1')):
self.bot.bet(self.big_raise("R1"))
elif equity > 55 or self.r_test(0.02, 'c2'):
self.bot.bet(self.minimum_bet("R2"))
Expand All @@ -134,7 +137,7 @@ def pick_action(self, equity, pot_odds):
return_ratio = equity / pot_odds
self.bot.log(" return ratio={}".format(return_ratio))
if equity > 70 or (equity > 40 and self.r_test(0.03, 'po1')):
self.bot.bet(self.big_raise("R2"))
self.bot.bet(self.big_raise("R3"))
elif return_ratio > 1:
self.bot.call(to_call)
else:
Expand All @@ -153,7 +156,7 @@ def __round_bet(self, val):
return int(round(val))

def minimum_bet(self, source=None):
"""Returns a minimum bet, 2.5-4 BB"""
"""Returns a minimum bet, 2-4 * BB"""
bet = self.data.big_blind * random.uniform(2, 4)
self.bot.log(" min bet of {b} from {s}"
.format(b=bet, s=source))
Expand Down

0 comments on commit 8b38aed

Please sign in to comment.