poker
Class Context
java.lang.Object
poker.Context
- All Implemented Interfaces:
- java.io.Serializable
public class Context
- extends java.lang.Object
- implements java.io.Serializable
This messy looking class is just a simple container for a zillion
different nibblets of context information associated with player
actions. Used for opponent modelling.
- Version:
- 1.0.1
- Author:
- Aaron Davidson
- See Also:
- Serialized Form
Method Summary |
boolean |
aceOnBoard()
|
boolean |
flushPossible(int nc)
|
int |
getAction()
|
double |
getAmountBet()
|
double |
getBetRatio()
|
int |
getBetSize()
|
double |
getBetsToCall()
|
Hand |
getBoard()
|
int |
getButton()
|
boolean |
getCommitted()
|
int |
getCommittment()
|
Hand |
getHand()
|
double |
getHandPotential()
|
double |
getHandStrength()
|
boolean |
getInHand()
|
int |
getLastAction()
|
int |
getLastActionCode()
|
static int |
getLastActionCode(int last_action,
int lastbets)
|
int |
getLastBetsToCall()
|
int |
getMinBet()
|
int |
getNumActivePlayers()
|
int |
getNumPlayers()
|
int |
getNumRaises()
|
int |
getNumSuits()
|
int |
getNumToAct()
|
int |
getNumUnactedPlayers()
|
int |
getPosition()
|
int |
getPositionCode()
|
double |
getPotOdds()
|
int |
getPotSize()
|
boolean |
getSawCards()
|
int |
getStage()
|
double |
highCards(int nc)
|
boolean |
kingOnBoard()
|
void |
saveToFile(java.lang.String file)
append context data to the given file |
void |
setAction(int a)
|
void |
setActionContext(int action,
double bets,
boolean committed,
int stage,
double potodds,
int numRaises)
|
void |
setBetSize(int bs)
|
void |
setBoardContext(Hand board)
|
void |
setGameContext(int pot,
int betsize,
int id)
|
void |
setHandContext(Hand h,
double hs,
double ppot)
|
void |
setHistoryContext(int lastAction,
int lastBetsToCall,
double betRatio)
|
void |
setInHand(boolean ih)
|
void |
setNumRaises(int nr)
|
void |
setPlayerContext(int numPlayers,
int numActivePlayers,
int numUnactedPlayers,
int pos,
boolean we_are_in_hand)
|
void |
setPotSize(int ps)
|
void |
setSawCards(boolean sc)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Context
public Context()
Context
public Context(PlayerInfo pi,
int act,
double betsCalled)
Context
public Context(java.lang.String s)
getAmountBet
public double getAmountBet()
setGameContext
public void setGameContext(int pot,
int betsize,
int id)
getMinBet
public int getMinBet()
setActionContext
public void setActionContext(int action,
double bets,
boolean committed,
int stage,
double potodds,
int numRaises)
setNumRaises
public void setNumRaises(int nr)
setBetSize
public void setBetSize(int bs)
setPotSize
public void setPotSize(int ps)
setInHand
public void setInHand(boolean ih)
setSawCards
public void setSawCards(boolean sc)
getSawCards
public boolean getSawCards()
setPlayerContext
public void setPlayerContext(int numPlayers,
int numActivePlayers,
int numUnactedPlayers,
int pos,
boolean we_are_in_hand)
setHistoryContext
public void setHistoryContext(int lastAction,
int lastBetsToCall,
double betRatio)
setBoardContext
public void setBoardContext(Hand board)
setHandContext
public void setHandContext(Hand h,
double hs,
double ppot)
setAction
public void setAction(int a)
getAction
public int getAction()
getBetsToCall
public double getBetsToCall()
getCommitted
public boolean getCommitted()
getStage
public int getStage()
getNumPlayers
public int getNumPlayers()
getNumActivePlayers
public int getNumActivePlayers()
getNumUnactedPlayers
public int getNumUnactedPlayers()
getPosition
public int getPosition()
getLastAction
public int getLastAction()
getLastBetsToCall
public int getLastBetsToCall()
getInHand
public boolean getInHand()
getNumToAct
public int getNumToAct()
getPotOdds
public double getPotOdds()
getBetRatio
public double getBetRatio()
getHandStrength
public double getHandStrength()
getHandPotential
public double getHandPotential()
getBoard
public Hand getBoard()
getHand
public Hand getHand()
getNumRaises
public int getNumRaises()
getPotSize
public int getPotSize()
getBetSize
public int getBetSize()
getButton
public int getButton()
getLastActionCode
public int getLastActionCode()
getLastActionCode
public static int getLastActionCode(int last_action,
int lastbets)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
saveToFile
public void saveToFile(java.lang.String file)
- append context data to the given file
- Parameters:
file
- the name of the file to log to.
getNumSuits
public int getNumSuits()
flushPossible
public boolean flushPossible(int nc)
aceOnBoard
public boolean aceOnBoard()
kingOnBoard
public boolean kingOnBoard()
highCards
public double highCards(int nc)
getCommittment
public int getCommittment()
getPositionCode
public int getPositionCode()