p129 - fixed stud river in HudCache generation

PrintPlayerHud... now uses bigbet rather than bigblind to determine gametype.
This commit is contained in:
steffen123 2008-10-09 06:15:50 +01:00
parent 5dfa5061cf
commit 14eb29f702
7 changed files with 117 additions and 14 deletions

View File

@ -1526,10 +1526,26 @@ def generateHudCacheData(player_ids, base, category, action_types, allIns, actio
if (len(action_types[3][player])>0 or isAllIn):
myStreet3Seen=True
mySawShowdown=True
for count in range (len(action_types[3][player])):
if action_types[3][player][count]=="fold":
mySawShowdown=False
print "base:", base
if base=="hold":
mySawShowdown=True
for count in range (len(action_types[3][player])):
if action_types[3][player][count]=="fold":
mySawShowdown=False
else:
print "in else"
for i in range(len(allIns[3][player])):
if allIns[3][player][i]:
isAllIn=True
if (len(action_types[4][player])>0 or isAllIn):
print "in if"
myStreet4Seen=True
mySawShowdown=True
for count in range (len(action_types[4][player])):
if action_types[4][player][count]=="fold":
mySawShowdown=False
#flop stuff
street=1
@ -1585,6 +1601,24 @@ def generateHudCacheData(player_ids, base, category, action_types, allIns, actio
if action_types[street][player][countOtherFold]=="fold":
myFoldToOtherRaisedStreet3=True
#stud river stuff - copy of flop with different vars
street=4
if myStreet4Seen:
for count in range(len(action_types[street][player])):
if action_types[street][player][count]=="bet":
myStreet4Aggr=True
for otherPlayer in range (len(player_ids)):
if player==otherPlayer:
pass
else:
for countOther in range (len(action_types[street][otherPlayer])):
if action_types[street][otherPlayer][countOther]=="bet":
myOtherRaisedStreet4=True
for countOtherFold in range (len(action_types[street][player])):
if action_types[street][player][countOtherFold]=="fold":
myFoldToOtherRaisedStreet4=True
if winnings[player]!=0:
if myStreet1Seen:
myWonWhenSeenStreet1=winnings[player]/float(totalWinnings)

View File

@ -23,7 +23,7 @@ from optparse import OptionParser
import fpdb_util_lib as ful
parser = OptionParser()
parser.add_option("-b", "--bigblind", default="2", type="int", help="big blinds in cent")
parser.add_option("-b", "--bigBet", default="4", type="int", help="big bet in cent")
parser.add_option("-c", "--cat", "--category", default="holdem", help="Category, e.g. holdem or studhilo")
parser.add_option("-e", "--seats", default="7", type="int", help="number of active seats")
parser.add_option("-g", "--gameType", default="ring", help="Whether its a ringgame (ring) or a tournament (tour)")
@ -42,19 +42,19 @@ print "Connected to MySQL on localhost. Print Player Flags Utility"
print ""
print "Basic Data"
print "=========="
print "bigblind:",options.bigblind, "category:",options.cat, "limitType:", options.limit, "name:", options.name, "gameType:", options.gameType, "site:", options.site
print "bigBet:",options.bigBet, "category:",options.cat, "limitType:", options.limit, "name:", options.name, "gameType:", options.gameType, "site:", options.site
cursor.execute("SELECT id FROM Sites WHERE name=%s", (options.site,))
siteId=cursor.fetchone()[0]
cursor.execute("SELECT id FROM Gametypes WHERE bigBlind=%s AND category=%s AND siteId=%s AND limitType=%s AND type=%s", (options.bigblind, options.cat, siteId, options.limit, options.gameType))
cursor.execute("SELECT id FROM Gametypes WHERE bigBet=%s AND category=%s AND siteId=%s AND limitType=%s AND type=%s", (options.bigBet, options.cat, siteId, options.limit, options.gameType))
gametypeId=cursor.fetchone()[0]
cursor.execute("SELECT id FROM Players WHERE name=%s", (options.name,))
playerId=cursor.fetchone()[0]
cursor.execute("SELECT id FROM HudCache WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s AND position=%s",(gametypeId, playerId, options.seats, options.position))
#print "debug: gametypeId:", gametypeId, "playerId:", playerId, "options.seats:", options.seats, "options.position:", options.position
cursor.execute("SELECT id FROM HudCache WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s AND position=%s",(gametypeId, playerId, options.seats, options.position))
hudDataId=cursor.fetchone()[0]
print "siteId:", siteId, "gametypeId:", gametypeId, "playerId:", playerId, "hudDataId:", hudDataId

View File

@ -2,7 +2,7 @@ Connected to MySQL on localhost. Print Player Flags Utility
Basic Data
==========
bigblind: 2 category: holdem limitType: fl name: Player_5 gameType: ring site: PokerStars
bigBet: 4 category: holdem limitType: fl name: Player_5 gameType: ring site: PokerStars
siteId: 2 gametypeId: 1 playerId: 5 hudDataId: 12
HUD Raw Hand Counts
@ -33,8 +33,8 @@ foldToOtherRaisedStreet2: 0
foldToOtherRaisedStreet3: 0
foldToOtherRaisedStreet4: 0
wonWhenSeenStreet1: 0
wonAtSD: 0
wonWhenSeenStreet1: 0.0
wonAtSD: 0.0
stealAttemptChance: 0
stealAttempted: 0
foldBbToStealChance: 0

View File

@ -2,7 +2,7 @@ Connected to MySQL on localhost. Print Player Flags Utility
Basic Data
==========
bigblind: 25 category: holdem limitType: fl name: player3 gameType: ring site: PokerStars
bigBet: 50 category: holdem limitType: fl name: player3 gameType: ring site: PokerStars
siteId: 2 gametypeId: 2 playerId: 11 hudDataId: 22
HUD Raw Hand Counts

View File

@ -2,7 +2,7 @@ Connected to MySQL on localhost. Print Player Flags Utility
Basic Data
==========
bigblind: 2 category: holdem limitType: fl name: Player_1 gameType: ring site: PokerStars
bigBet: 4 category: holdem limitType: fl name: Player_1 gameType: ring site: PokerStars
siteId: 2 gametypeId: 1 playerId: 1 hudDataId: 8
HUD Raw Hand Counts

View File

@ -0,0 +1,68 @@
Connected to MySQL on localhost. Print Player Flags Utility
Basic Data
==========
bigBet: 20 category: studhilo limitType: fl name: br1an gameType: ring site: PokerStars
siteId: 2 gametypeId: 3 playerId: 21 hudDataId: 32
HUD Raw Hand Counts
===================
HDs: 1
street0VPI: 0
street0Aggr: 0
street0_3B4BChance: 0
street0_3B4BDone: 0
street1Seen: 1
street2Seen: 1
street3Seen: 1
street4Seen: 1
sawShowdown: 1
street1Aggr: 0
street2Aggr: 0
street3Aggr: 0
street4Aggr: 0
otherRaisedStreet1: 0
otherRaisedStreet2: 1
otherRaisedStreet3: 0
otherRaisedStreet4: 1
foldToOtherRaisedStreet1: 0
foldToOtherRaisedStreet2: 0
foldToOtherRaisedStreet3: 0
foldToOtherRaisedStreet4: 0
wonWhenSeenStreet1: 0.0
wonAtSD: 0.0
stealAttemptChance: 0
stealAttempted: 0
foldBbToStealChance: 0
foldedBbToSteal: 0
foldSbToStealChance: 0
foldedSbToSteal: 0
street1CBChance: 0
street1CBDone: 0
street2CBChance: 0
street2CBDone: 0
street3CBChance: 0
street3CBDone: 0
street4CBChance: 0
street4CBDone: 0
foldToStreet1CBChance: 0
foldToStreet1CBDone: 0
foldToStreet2CBChance: 0
foldToStreet2CBDone: 0
foldToStreet3CBChance: 0
foldToStreet3CBDone: 0
foldToStreet4CBChance: 0
foldToStreet4CBDone: 0
totalProfit: -0.47
street1CheckCallRaiseChance: 0
street1CheckCallRaiseDone: 0
street2CheckCallRaiseChance: 0
street2CheckCallRaiseDone: 0
street3CheckCallRaiseChance: 0
street3CheckCallRaiseDone: 0
street4CheckCallRaiseChance: 1
street4CheckCallRaiseDone: 0

View File

@ -33,12 +33,13 @@ echo "it should've reported first that it stored 3, then that it had 3 duplicate
../pyfpdb/fpdb_import.py -p$1 --file=ps-lhe-ring-call-3B-preflop-cb-no2b.txt -x
echo "it should've now reported another successful store of 1 hand"
./PrintPlayerHudData.py -p$1 -nplayer3 -oE -e10 -b25 > ps-flags-CBflop.found.txt && colordiff ps-flags-CBflop.found.txt ps-flags-CBflop.expected.txt
./PrintPlayerHudData.py -p$1 -nplayer3 -oE -e10 -b50 > ps-flags-CBflop.found.txt && colordiff ps-flags-CBflop.found.txt ps-flags-CBflop.expected.txt
../pyfpdb/fpdb_import.py -p$1 --file=ps-studhilo-ring-showdown.txt -x
echo "it should've now reported another successful store of 1 hand"
./PrintHand.py -p$1 --hand=15043388146 > ps.15043388146.found.txt && colordiff ps.15043388146.found.txt ps.15043388146.expected.txt
./PrintPlayerHudData.py -p$1 -nbr1an -o0 -e6 -b20 -cstudhilo> ps-flags-studhilo.found.txt && colordiff ps-flags-studhilo.found.txt ps-flags-studhilo.expected.txt
echo "if everything was printed as expected this worked"