|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.javaflair.pokerprophesier.api.adapter.PokerProphesierAdapter
public class PokerProphesierAdapter
The adapter is the principle class which clients use to communicate with the simulator. Typically, a client instantiates an adapter, sets the simulator parameters as required, runs the simulator using the specified hole cards, community cards and game state (i.e. hole cards dealt, flop cards dealt etc.) and then gets references to the helpers which the simulator populates, in order to retrieve the simulator results.
There are two types of simulation: A Me vs Opponents simulation and a Player vs Player simulation.
A Me vs Opponents simulation is from the perspective of me as a player in a game against several opponents. Using a mixture of simulation and pure statistics, the simulator uses my hole cards and the shared community cards to calculate my outs, the probability of improving my hand by the river, the probable hand any single opponent currently holds against my hand and my overall probability of winning the game.
The Me vs Opponents simulation can be configured to include/exclude certain types of hands when generating and calculating the simulation statistics. These parameters must be set before the simulation is executed. See the following methods:
isMyOutsHoleCardSensitive()/setMyOutsHoleCardSensitive(boolean)
isOppProbMyHandSensitive()/setOppProbMyHandSensitive(boolean)
isOppHoleCardsRealistic()/setOppHoleCardsRealistic(boolean)
The Me vs Opponents simulation is executed by calling the method
runMySimulations(HoleCards, CommunityCards, int, int). After the
method completes, the following helpers are populated (depending on the game
state):
MyHandHelper - A helper which contains the analysis of my
current hand (getMyHandHelper())
MyOutsHelper - A helper which contains the details of my current
outs (getMyOutsHelper())
MyHandStatsHelper - A helper which contains the probabilities of
my making a particular hand by the river card (getMyHandStatsHelper())
OppHandStatsHelper - A helper which contains the probabilities
of an opponent currently holding a particular hand (getOppHandStatsHelper())
MyGameStatsHelper - A helper which contains the probabilities of
my winning, tying or losing the game (getMyGameStatsHelper())
A Player vs Player simulation calculates the probability of every player in a group of players winning or tying a game, given the specified hole cards of each player and the shared community cards.
The Player vs Player simulation is executed by calling the method
runPlayerSimulations(HoleCards[], CommunityCards, int). After the
method completes, the following helper is populated:
PlayerGameStatsHelper - A helper which contains the
probabilities of each player winning/tying the game (getPlayerGameStatsHelper())
The number of iterations (individual Hold'em games) to perform when executing
both simulations can be defined using the following method:
setNumSimulations(int). The default is 100000.
For examples of how to use the adapter, see the examples which are included in the installation nd are also available online: MySimulatorExample.java and PlayerSimulatorExample.java.
| Field Summary | |
|---|---|
static int |
FLOP_CARDS_DEALT
Game state: flop cards dealt |
static int |
HOLE_CARDS_DEALT
Game state: hole cards dealt |
static int |
RIVER_CARD_DEALT
Game state: river card dealt |
static int |
TURN_CARD_DEALT
Game state: turn card dealt |
| Constructor Summary | |
|---|---|
PokerProphesierAdapter()
Constructs an instance of the adapter. |
|
| Method Summary | |
|---|---|
MyGameStatsHelper |
getMyGameStatsHelper()
Returns the helper which contains the probabilities of my winning, tying or losing the game. |
MyHandHelper |
getMyHandHelper()
Returns the helper which contains the analysis of my current hand. |
MyHandStatsHelper |
getMyHandStatsHelper()
Returns the helper which contains the probabilities of my making a particular hand by the river card. |
MyOutsHelper |
getMyOutsHelper()
Returns the helper which contains the details and probabilities of my current outs. |
int |
getNumSimulations()
Returns the number of iterations (individual Hold'em games) to perform when executing a simulation. |
OppHandStatsHelper |
getOppHandStatsHelper()
Returns the helper which contains the probabilities of an opponent currently holding a particular hand. |
PlayerGameStatsHelper |
getPlayerGameStatsHelper()
Returns the helper which contains the probabilities of each player winning/tying the game. |
UpdateHelper |
getUpdateHelper()
Returns the update helper, which can be used to determine whether this installation of Poker Prophesier is current. |
boolean |
isMyOutsHoleCardSensitive()
Returns a boolean indicating whether the significant (non-kicker) cards in my hand must contain at least one hole card to be included in the generated simulator statistics. |
boolean |
isOppHoleCardsRealistic()
Returns a boolean indicating whether the simulator should use realistic, or at least vaguely playable, opponents' hole cards when determining possible opponents' hands. |
boolean |
isOppProbMyHandSensitive()
Returns a boolean indicating whether an opponents' hand should only be included in the generated simulator statistics if it is better than my current hand. |
void |
runMySimulations(HoleCards holeCards,
CommunityCards communityCards,
int numSimPlayers,
int currentRound)
Runs the Me vs Opponents simulation, using my hole cards, the community cards, the total number of simulator players and the current game state. |
void |
runPlayerSimulations(HoleCards[] holeCards,
CommunityCards communityCards,
int currentRound)
Runs the Player vs Player simulation, using the array of players' hole cards, the community cards and the current game state. |
void |
setMyOutsHoleCardSensitive(boolean isMyOutsHoleCardSensitive)
Sets the boolean indicating whether the significant (non-kicker) cards in my hand must contain at least one hole card to be included in the generated simulator statistics. |
void |
setNumSimulations(int numSimulations)
Sets the number of iterations (individual Hold'em games) to perform when executing a simulation. |
void |
setOppHoleCardsRealistic(boolean isOppHoleCardsRealistic)
Sets the boolean indicating whether the simulator should use realistic, or at least vaguely playable, opponents' hole cards when determining possible opponents' hands. |
void |
setOppProbMyHandSensitive(boolean isOppProbMyHandSensitive)
Sets the boolean indicating whether an opponents' hand should only be included in the generated simulator statistics if it is better than my current hand. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int HOLE_CARDS_DEALT
public static final int FLOP_CARDS_DEALT
public static final int TURN_CARD_DEALT
public static final int RIVER_CARD_DEALT
| Constructor Detail |
|---|
public PokerProphesierAdapter()
| Method Detail |
|---|
public void runMySimulations(HoleCards holeCards,
CommunityCards communityCards,
int numSimPlayers,
int currentRound)
throws SimulatorException
MyHandHelper - A helper which contains the analysis of my
current hand (getMyHandHelper())
MyOutsHelper - A helper which contains the details and
probabilities of my current outs (getMyOutsHelper())
MyHandStatsHelper - A helper which contains the
probabilities of my making a particular hand by the river card (getMyHandStatsHelper())
OppHandStatsHelper - A helper which contains the
probabilities of an opponent currently holding a particular hand (getOppHandStatsHelper())
MyGameStatsHelper - A helper which contains the
probabilities of my winning, tying or losing the game (getMyGameStatsHelper())
holeCards - my hole cardscommunityCards - the community cardsnumSimPlayers - the total number of simulator players (including
me)currentRound - the current round of the game:
HOLE_CARDS_DEALT,
FLOP_CARDS_DEALT,
TURN_CARD_DEALT
or
RIVER_CARD_DEALT.
SimulatorException - any simulator exceptionHoleCards,
CommunityCards
public void runPlayerSimulations(HoleCards[] holeCards,
CommunityCards communityCards,
int currentRound)
throws SimulatorException
PlayerGameStatsHelper - A helper which contains the
probabilities of each player winning/tying the game (getPlayerGameStatsHelper())
holeCards - the players' hole cardscommunityCards - the community cardscurrentRound - the current round of the game:
HOLE_CARDS_DEALT,
FLOP_CARDS_DEALT,
TURN_CARD_DEALT
or
RIVER_CARD_DEALT.
SimulatorException - any simulator exceptionHoleCards,
CommunityCards
public UpdateHelper getUpdateHelper()
throws SimulatorException
SimulatorException - any simulator exceptionpublic MyHandHelper getMyHandHelper()
Populated after the
runMySimulations(HoleCards, CommunityCards, int, int)
simulator method is executed in all game states.
null if not populatedrunMySimulations(HoleCards,
CommunityCards, int, int)public MyGameStatsHelper getMyGameStatsHelper()
Populated after the
runMySimulations(HoleCards, CommunityCards, int, int)
simulator method is executed in all game states.
null if not populatedrunMySimulations(HoleCards,
CommunityCards, int, int)public MyHandStatsHelper getMyHandStatsHelper()
Populated after the
runMySimulations(HoleCards, CommunityCards, int, int)
simulator method is executed, during the following game states:
HOLE_CARDS_DEALT,
FLOP_CARDS_DEALT
and
TURN_CARD_DEALT.
null if not populatedrunMySimulations(HoleCards,
CommunityCards, int, int)public MyOutsHelper getMyOutsHelper()
Populated after the
runMySimulations(HoleCards, CommunityCards, int, int)
simulator method is executed, during the following game states:
FLOP_CARDS_DEALT
and
TURN_CARD_DEALT.
null if not populatedrunMySimulations(HoleCards,
CommunityCards, int, int)public OppHandStatsHelper getOppHandStatsHelper()
Populated after the
runMySimulations(HoleCards, CommunityCards, int, int)
simulator method is executed, during the following game states:
FLOP_CARDS_DEALT,
TURN_CARD_DEALT
and
RIVER_CARD_DEALT.
null if not
populatedrunMySimulations(HoleCards,
CommunityCards, int, int)public PlayerGameStatsHelper getPlayerGameStatsHelper()
Populated after the
runPlayerSimulations(HoleCards[], CommunityCards, int)
simulator method is executed in all game states.
null if not
populatedrunPlayerSimulations(HoleCards[],
CommunityCards, int)public boolean isMyOutsHoleCardSensitive()
Default is true - only applicable as a parameter to the
runMySimulations(HoleCards, CommunityCards, int, int)
simulation.
public void setMyOutsHoleCardSensitive(boolean isMyOutsHoleCardSensitive)
Default is true - only applicable as a parameter to the
runMySimulations(HoleCards, CommunityCards, int, int)
simulation.
isMyOutsHoleCardSensitive - the boolean flagpublic boolean isOppProbMyHandSensitive()
Default is true - only applicable as a parameter to the
runMySimulations(HoleCards, CommunityCards, int, int)
simulation.
public void setOppProbMyHandSensitive(boolean isOppProbMyHandSensitive)
Default is true - only applicable as a parameter to the
runMySimulations(HoleCards, CommunityCards, int, int)
simulation.
isOppProbMyHandSensitive - the boolean flagpublic boolean isOppHoleCardsRealistic()
Default is true - only applicable as a parameter to the
runMySimulations(HoleCards, CommunityCards, int, int)
simulation.
public void setOppHoleCardsRealistic(boolean isOppHoleCardsRealistic)
Default is true - only applicable as a parameter to the
runMySimulations(HoleCards, CommunityCards, int, int)
simulation.
isOppHoleCardsRealistic - the boolean flagisOppHoleCardsRealistic()public int getNumSimulations()
Default is 100000 - applicable to both simulations.
public void setNumSimulations(int numSimulations)
Default is 100000 - applicable to both simulations.
numSimulations - the number of simulations
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||