-
Notifications
You must be signed in to change notification settings - Fork 1
Home
aliang edited this page Jan 10, 2011
·
8 revisions
List of Pokerbot methods (using dir(), help() and vars()) See also Things they may not have documented
p1 = Pokerbot('Template')
help(p1)
class Pokerbot(__builtin__.object)
| A pokerbot is instantiated with a string that corresponds to the brain
| file.
|
| Methods defined here:
|
| __init__(self, bot)
|
| respond(self, game_state)
| Maps a state dictionary into variables for a bot to use and then
| queries for a response
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
dir(p1)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__',
'active', 'all_in', 'bot', 'button', 'hand', 'name', 'pip', 'respond', 'seat', 'stack']
vars(p1)
{'name': 'testbot', 'button': False, 'bot': <pokerbots.player.bot.Template instance at 0x570b48>, 'hand': None, 'pip': 0,
'active': False, 'seat': 1, 'stack': 400, 'all_in': False}
p2 = Pokerbot('Template')
t = Table(p1,p2)
help(t)
Help on Table in module pokerbots.engine.game object:
class Table(__builtin__.object)
| An NLHE table that runs a game
|
| Methods defined here:
|
| __init__(self, p1, p2)
|
| collect(self, p, owe)
| Collects what a player owes, adjusts their pip and the pot
|
| deal(self)
| Deals preflop cards or the flop/turn/river
|
| deck(self)
| Build a fresh deck
|
| legality(self, p, response)
| Determines if an action is legal or not
|
| pay(self, p, owe)
| Pays a player what he is owed
|
| pay_up(self)
| Switches the button and posts blinds
|
| play(self)
| Plays a hand of poker
|
| postflop_action(self)
| Betting round after the flop
|
| postflop_legal(self)
|
| postflop_update(self, p, response)
| Updates the internal game state based on a postflop action
|
| preflop_action(self)
| Betting round before the flop
|
| preflop_legal(self)
| Generates legal actions based on the current game state
|
| preflop_update(self, p, response)
| Updates the internal game state based on a preflop action
|
| refund(self)
| Issues a refund on uncalled bets/raises
|
| showdown(self)
| Declares a winner and evaluates hands if necessary, awards pot
|
| state(self)
| Creates a dictionary representation of the game state for a pokerbot
| so that it can represent its internal state properly
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
dir(t)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__',
'actions', 'bb', 'blinds', 'board', 'collect', 'deal', 'deck', 'eval', 'hands_played',
'legal', 'legality', 'logger', 'ongoing', 'p1', 'p2', 'pay', 'pay_up', 'play',
'postflop_action', 'postflop_legal', 'postflop_update', 'pot',
'preflop_action', 'preflop_legal', 'preflop_update', 'refund', 'sb', 'showdown', 'state']
vars(t)
{'p2': <pokerbots.player.pokerbot.Pokerbot object at 0x57ce70>,
'p1': <pokerbots.player.pokerbot.Pokerbot object at 0x39b0b0>,
'hands_played': 0,
'bb': 2,
'deck': Deck(['Card(2, 1)', 'Card(3, 1)', 'Card(4, 1)', 'Card(5, 1)', 'Card(6, 1)', 'Card(7, 1)', 'Card(8, 1)',
'Card(9, 1)', 'Card(10, 1)', 'Card(11, 1)', 'Card(12, 1)', 'Card(13, 1)', 'Card(14, 1)',
'Card(2, 2)', 'Card(3, 2)', 'Card(4, 2)', 'Card(5, 2)', 'Card(6, 2)', 'Card(7, 2)', 'Card(8, 2)',
'Card(9, 2)', 'Card(10, 2)', 'Card(11, 2)', 'Card(12, 2)', 'Card(13, 2)', 'Card(14, 2)',
'Card(2, 3)', 'Card(3, 3)', 'Card(4, 3)', 'Card(5, 3)', 'Card(6, 3)', 'Card(7, 3)', 'Card(8, 3)',
'Card(9, 3)', 'Card(10, 3)', 'Card(11, 3)', 'Card(12, 3)', 'Card(13, 3)', 'Card(14, 3)',
'Card(2, 4)', 'Card(3, 4)', 'Card(4, 4)', 'Card(5, 4)', 'Card(6, 4)', 'Card(7, 4)', 'Card(8, 4)',
'Card(9, 4)', 'Card(10, 4)', 'Card(11, 4)', 'Card(12, 4)', 'Card(13, 4)', 'Card(14, 4)'], []),
'pot': 0, 'legal': None, 'ongoing': False, 'board': Board([]),
'eval': <pokerbots.engine.utilities.HandEval object at 0x5740b0>,
'sb': 1,
'logger': <pokerbots.engine.utilities.Logger object at 0x62c0b0>,
'blinds': <pokerbots.engine.game.Blinds object at 0x62c0d0>,
'actions': []}