[NEWIMPORT] Calculate wonWhenSeenStreet1

Won is defined as 'collected money from the pot'

Seen street 1 does not require vpip on street 0
This commit is contained in:
Worros 2009-11-24 21:58:27 +08:00
parent e9a858e4cd
commit dc1b0d2e38
2 changed files with 14 additions and 9 deletions

View File

@ -1406,7 +1406,8 @@ class Database:
pdata[p]['street1Aggr'], pdata[p]['street1Aggr'],
pdata[p]['street2Aggr'], pdata[p]['street2Aggr'],
pdata[p]['street3Aggr'], pdata[p]['street3Aggr'],
pdata[p]['street4Aggr'] pdata[p]['street4Aggr'],
pdata[p]['wonWhenSeenStreet1']
) ) ) )
q = """INSERT INTO HandsPlayers ( q = """INSERT INTO HandsPlayers (
@ -1433,10 +1434,11 @@ class Database:
street1Aggr, street1Aggr,
street2Aggr, street2Aggr,
street3Aggr, street3Aggr,
street4Aggr street4Aggr,
wonWhenSeenStreet1
) )
VALUES ( VALUES (
%s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
@ -1458,7 +1460,6 @@ class Database:
# foldToOtherRaisedStreet2, # foldToOtherRaisedStreet2,
# foldToOtherRaisedStreet3, # foldToOtherRaisedStreet3,
# foldToOtherRaisedStreet4, # foldToOtherRaisedStreet4,
# wonWhenSeenStreet1,
# stealAttemptChance, # stealAttemptChance,
# stealAttempted, # stealAttempted,
# foldBbToStealChance, # foldBbToStealChance,

View File

@ -43,6 +43,7 @@ class DerivedStats():
self.handsplayers[player[1]]['totalProfit'] = 0 self.handsplayers[player[1]]['totalProfit'] = 0
self.handsplayers[player[1]]['street4Seen'] = False self.handsplayers[player[1]]['street4Seen'] = False
self.handsplayers[player[1]]['street4Aggr'] = False self.handsplayers[player[1]]['street4Aggr'] = False
self.handsplayers[player[1]]['wonWhenSeenStreet1'] = False
self.assembleHands(self.hand) self.assembleHands(self.hand)
self.assembleHandsPlayers(self.hand) self.assembleHandsPlayers(self.hand)
@ -104,6 +105,12 @@ class DerivedStats():
self.handsplayers[player[1]]['seatNo'] = player[0] self.handsplayers[player[1]]['seatNo'] = player[0]
self.handsplayers[player[1]]['startCash'] = player[2] self.handsplayers[player[1]]['startCash'] = player[2]
for i, street in enumerate(hand.actionStreets[2:]):
self.seen(self.hand, i+1)
for i, street in enumerate(hand.actionStreets[1:]):
self.aggr(self.hand, i)
# Winnings is a non-negative value of money collected from the pot, which already includes the # Winnings is a non-negative value of money collected from the pot, which already includes the
# rake taken out. hand.collectees is Decimal, database requires cents # rake taken out. hand.collectees is Decimal, database requires cents
for player in hand.collectees: for player in hand.collectees:
@ -113,15 +120,12 @@ class DerivedStats():
# different sites calculate rake differently. # different sites calculate rake differently.
# Should be fine for split-pots, but won't be accurate for multi-way pots # Should be fine for split-pots, but won't be accurate for multi-way pots
self.handsplayers[player]['rake'] = int(100* hand.rake)/len(hand.collectees) self.handsplayers[player]['rake'] = int(100* hand.rake)/len(hand.collectees)
if self.handsplayers[player]['street1Seen'] == True:
self.handsplayers[player]['wonWhenSeenStreet1'] = True
for player in hand.pot.committed: for player in hand.pot.committed:
self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player])) self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player]))
for i, street in enumerate(hand.actionStreets[2:]):
self.seen(self.hand, i+1)
for i, street in enumerate(hand.actionStreets[1:]):
self.aggr(self.hand, i)
#default_holecards = ["Xx", "Xx", "Xx", "Xx"] #default_holecards = ["Xx", "Xx", "Xx", "Xx"]
#if hand.gametype['base'] == "hold": #if hand.gametype['base'] == "hold":