|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbot.Bot
public abstract class Bot
The frame for the whole bot. Strategy is to be implemented in a child class.
Field Summary | |
---|---|
protected java.lang.Integer |
buyin
|
protected java.util.List<IF_GetEquity> |
equities
|
protected java.util.List<IF_GetEstimation> |
estimations
|
protected java.util.List<IF_ExtModule_Feed> |
extFeeds
|
protected java.util.List<IF_SetGameStorage> |
gameStorage
|
protected java.lang.String |
myname
|
protected java.util.List<IF_GetProposal> |
proposals
|
(package private) java.security.SecureRandom |
random
|
protected State |
state
|
protected Talk |
talk
|
Constructor Summary | |
---|---|
Bot(java.lang.String config)
Reads in the bots configuration file and initializes the bot accordingly. |
Method Summary | |
---|---|
void |
addAction(int round,
char actionChar)
|
void |
addAction(int round,
char actionChar,
int finalInPot)
|
void |
endHand()
Sets the end of the hand by updating the state. |
void |
endLastRound(Card[][] cards)
|
void |
gameOver()
|
abstract int[] |
getBet()
Returns the actual bet, which is to be sent to the server. |
int |
getBuyin()
|
java.lang.String |
getName()
|
int |
getNumPlayers()
|
protected int[] |
getRandomBet()
Returns a random bet (10% folding; 70% calling; 30% default raise) |
void |
handleStateChange()
If it is the bot's turn, this method calls the getBet() method, converts the move and sends it to the talk object. |
private void |
initExtProposal()
|
private boolean |
isCall20able(int[] cashs,
int raiseDelta)
|
protected abstract boolean |
isPlayable()
The specific bot can decide, if he want to / can play this kind of game. |
boolean |
newGame(Gamedef gamedef)
Initializes a new game. |
void |
newRound()
|
void |
printState()
Writes the the current state to the console. |
private void |
provideNewActionInformation(Action action)
|
private void |
provideNewHandInformation(int button,
int round)
|
private void |
provideNewHoleCardsInformation(int player,
Card[] cards)
|
private void |
provideNewRoundInformation(int round,
Card[] newCards)
|
private void |
provideShowdownInformation(int[] winsPerPlayer)
|
void |
run()
Calls the run method of the talk object if the talk object is initialized. |
void |
setBlinds()
Sets the blinds accordingly to the game definition. |
void |
setBoardCards(int round,
Card[] cards)
Updates |
int |
setGetGamedef()
|
void |
setHand(int position,
int hand)
Sets the hand counter to the given and updates the position of the players. |
void |
setHoleCards(int player,
Card[] cards)
Sets the hole cards of the given player. |
void |
setNextActivePlayer()
|
void |
setPlayers(java.lang.String[] names,
int[] buyins)
Stores names & buyins of the players. |
void |
showdown(int[] profitsPerPlayer)
Allocates the profits of the players by the players order (the own index is at int[0]). |
void |
showdown(java.lang.String[] names,
int[] gains)
Allocates the profits of the players by name. |
void |
storeCompetitionEndData()
|
void |
storeCompetitionStartData()
|
void |
storeHandEndData()
|
void |
storeHandStartData()
|
void |
storeRoundEndData()
|
void |
storeRoundEndData(int n)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.security.SecureRandom random
protected java.lang.String myname
protected java.lang.Integer buyin
protected State state
protected Talk talk
protected java.util.List<IF_GetProposal> proposals
protected java.util.List<IF_GetEquity> equities
protected java.util.List<IF_GetEstimation> estimations
protected java.util.List<IF_ExtModule_Feed> extFeeds
protected java.util.List<IF_SetGameStorage> gameStorage
Constructor Detail |
---|
public Bot(java.lang.String config)
config
- - bots configuration fileMethod Detail |
---|
protected abstract boolean isPlayable()
public abstract int[] getBet()
BetInt
public void run()
protected int[] getRandomBet()
public void handleStateChange()
handleStateChange
in interface IF_Bot_Talk
public boolean newGame(Gamedef gamedef)
newGame
in interface IF_Bot_Talk
gamedef
- The definition of the game
isPlayable()
public void printState()
public void showdown(java.lang.String[] names, int[] gains)
showdown
in interface IF_Bot_Talk
names
- Names of the winnersgains
- Gains of the corresponding winnerspublic void showdown(int[] profitsPerPlayer)
showdown
in interface IF_Bot_Talk
profitsPerPlayer
- Profits of the playerspublic void setPlayers(java.lang.String[] names, int[] buyins)
names
- all names of the playersbuyins
- buy ins of the playerspublic void setBlinds()
setBlinds
in interface IF_Bot_Talk
public void setHand(int position, int hand)
ownPosition
- The own position in this handhand
- The number hand of the current hand.public void setHoleCards(int player, Card[] cards)
player
- Player who has the given hole cardscards
- Given board cardspublic void endLastRound(Card[][] cards)
endLastRound
in interface IF_Bot_Talk
public void endHand()
public void setBoardCards(int round, Card[] cards)
setBoardCards
in interface IF_Bot_Talk
public void setNextActivePlayer()
public void addAction(int round, char actionChar)
addAction
in interface IF_Bot_Talk
public void addAction(int round, char actionChar, int finalInPot)
addAction
in interface IF_Bot_Talk
public void newRound()
newRound
in interface IF_Bot_Talk
public java.lang.String getName()
getName
in interface IF_Bot_Talk
public int getBuyin()
getBuyin
in interface IF_Bot_Talk
public int setGetGamedef()
public void storeCompetitionStartData()
public void storeHandStartData()
public void storeRoundEndData()
public void storeRoundEndData(int n)
public void storeHandEndData()
public void storeCompetitionEndData()
public void gameOver()
gameOver
in interface IF_Bot_Talk
public int getNumPlayers()
private boolean isCall20able(int[] cashs, int raiseDelta)
private void initExtProposal()
private void provideNewHandInformation(int button, int round)
private void provideNewHoleCardsInformation(int player, Card[] cards)
private void provideNewActionInformation(Action action)
private void provideNewRoundInformation(int round, Card[] newCards)
private void provideShowdownInformation(int[] winsPerPlayer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |