|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.biotools.meerkat.HandEvaluator
public class HandEvaluator
Class for identifying / comparing / ranking Hands.
Constructor Summary | |
---|---|
HandEvaluator()
|
Method Summary | |
---|---|
static int |
compareHands(Hand h1,
Hand h2)
Compares two 5-to-7 hands against each other. |
static int |
compareHands(int rank1,
Hand h2)
Compares two 5-7 card hands against each other. |
static HandEval |
getHandEval()
Get the HandEval engine being used by the HandEvaluator |
static NChoose2IntTable |
getRanks(Hand board)
Given a board, cache all possible two card combinations of hand ranks, so that fast hand comparisons may be done later. |
static double |
handRank(Card c1,
Card c2,
Hand h)
Calculates the probability of currently having the best hand against one random opponent. |
static double |
handRank(Card c1,
Card c2,
Hand h,
int np)
Calculates the probability of having the best hand against several random opponents. |
static double |
handRank(Card c1,
Card c2,
NChoose2IntTable rankCache,
Deck dk)
Calculate the strength of the given hand. |
static boolean |
isTheNuts(Card c1,
Card c2,
Hand board,
NChoose2IntTable rankCache)
Determine if the hand is the nuts (no hands beat it) Does not consider draws, only the immediate conditions. |
static int |
rankHand(Card c1,
Card c2,
Hand h)
Get a numerical ranking of this hand. |
static int |
rankHand(Hand h)
Get a numerical ranking of this hand. |
static int |
rankHand(int c1,
int c2,
Hand h)
Get a numerical ranking of this hand. |
static int |
rankHand5(Hand h)
Get a numerical ranking of this hand. |
static int |
rankHand6(Hand h)
Get a numerical ranking of this hand. |
static int |
rankHand7(Hand h)
Get a numerical ranking of this hand. |
static void |
setHandEval(HandEval he)
Set the HandEval engine to be used by the HandEvaluator param an engine to compute hand evaluations |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HandEvaluator()
Method Detail |
---|
public static final int rankHand(Hand h)
h
- a 5-7 card hand
public static final int rankHand7(Hand h)
h
- a 7 card hand
public static final int rankHand6(Hand h)
h
- a 6 card hand
public static final int rankHand5(Hand h)
h
- a 5 card hand
public static int rankHand(int c1, int c2, Hand h)
h
- a 5-7 card hand
public static int rankHand(Card c1, Card c2, Hand h)
h
- a 5-7 card hand
public static int compareHands(Hand h1, Hand h2)
h1
- The first handh2
- The second hand
public static int compareHands(int rank1, Hand h2)
rank1
- The rank of the first handh2
- The second hand
public static NChoose2IntTable getRanks(Hand board)
public static double handRank(Card c1, Card c2, Hand h, int np)
c1
- hole card 1c2
- hole card 2h
- the boardnp
- the number of active opponents in the hand
public static double handRank(Card c1, Card c2, Hand h)
c1
- hole card 1c2
- hole card 2h
- the board
public static double handRank(Card c1, Card c2, NChoose2IntTable rankCache, Deck dk)
c1
- the first hole cardc2
- the second hole cardrankCache
- the ranks for all hands against a board where rankCache[i][j] =
the rank of Card(i) and Card(j) the array stores the same values
both in [i][j] and [j][i] for faster access times. (this cache
can be obtained from HandEvaluator.getRanks(Hand))dk
- the deck with all known cards removed
public static final boolean isTheNuts(Card c1, Card c2, Hand board, NChoose2IntTable rankCache)
public static HandEval getHandEval()
public static void setHandEval(HandEval he)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |