|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpoker.HandEvaluator
public class HandEvaluator
Class for identifying / comparing / ranking Hands.
Source Code: HandEvaluator.java
JNI Poker Evaluation Library Code
Constructor Summary | |
---|---|
HandEvaluator()
Construct a new Hand Evaluator. |
Method Summary | |
---|---|
static double |
CGetRanks(int[] board,
int[] ranks)
|
static double |
CHandRank(int c1,
int c2,
int[] board)
Calculates the probability of having the best hand against one opponent. |
static int |
compareHands(Hand h1,
Hand h2)
Compares two 7 card hands against each other. |
static int |
compareHands(int rank1,
Hand h2)
Compares two 5-7 card hands against each other. |
static int |
CRankHandFast(int[] cards)
Get a numerical ranking of this hand. |
static int |
CRankHandFast7(int[] cards)
Get a numerical ranking of this hand. |
static int |
Find_Hand(int[] hand,
int[] best)
|
static Hand |
getBest5CardHand(Hand h)
Get the best 5 card poker hand from a 7 card hand |
int |
getNumBetter()
Get the number of hands better than the last hand ranked. |
int |
getNumTied()
Get the number of hands tied with the last hand ranked. |
int |
getNumWorse()
Get the number of hands worse than the last hand ranked. |
static int[][] |
getRanks(Hand board)
Given a board, cache all possible two card combinations of hand ranks, so that lightenting fast hand comparisons may be done later. |
static int[][] |
getRanksNative(Hand board)
|
double |
handRank(Card c1,
Card c2,
Hand h)
Calculates the probability of having the best hand against one opponent. |
double |
handRank(Card c1,
Card c2,
Hand h,
int np)
Calculates the probability of having the best hand against several opponents. |
static double |
handRank(Card c1,
Card c2,
int[][] rankCache,
Deck dk)
Calculate the strength of the given hand. |
static double |
handRankNative(Card c1,
Card c2,
Hand h)
|
boolean |
isNative()
Returns true if the native evaluation library is loaded. |
static boolean |
isTheNuts(Card c1,
Card c2,
Hand board,
int[][] rankCache)
Determine if the hand is the nuts (no hands beat it) |
static java.lang.String |
nameHand(Card c1,
Card c2,
Hand b)
Given a hand, return a string naming the hand ('Ace High Flush', etc..) |
static java.lang.String |
nameHand(Hand h)
Given a hand, return a string naming the hand ('Ace High Flush', etc..) |
static double[] |
potential(Card c1,
Card c2,
Hand bd,
poker.ai.model.WeightTable wt)
|
static double |
ppot1(Card c1,
Card c2,
Hand bd,
poker.ai.model.WeightTable wt)
|
static double |
ppot1(int c1,
int c2,
int[] bd,
double[] weights,
double[] result)
|
static int |
rankHand_Java(Hand h)
Get a numerical ranking of this hand. |
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 |
rankHand7(Hand h)
Get a numerical ranking of this hand. |
static void |
test()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HandEvaluator()
Method Detail |
---|
public boolean isNative()
public static final int rankHand(Hand h)
h
- a 5-7 card hand
public static int rankHand(Card c1, Card c2, Hand h)
c1
- first hole cardc2
- second hole cardh
- a 3-5 card hand
public static java.lang.String nameHand(Card c1, Card c2, Hand b)
public static java.lang.String nameHand(Hand h)
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 int CRankHandFast(int[] cards)
cards
- an array of up to 7 card integers
public static int CRankHandFast7(int[] cards)
cards
- an array of 7 card integers
public static double CHandRank(int c1, int c2, int[] board)
c1
- hole card 1c2
- hole card 2board
- the board
public static double handRankNative(Card c1, Card c2, Hand h)
public static final int rankHand7(Hand h)
h
- a 7 card hand
public static double CGetRanks(int[] board, int[] ranks)
public static int[][] getRanksNative(Hand board)
public static int[][] getRanks(Hand board)
public 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 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, int[][] 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 int getNumWorse()
public int getNumBetter()
public int getNumTied()
public static final boolean isTheNuts(Card c1, Card c2, Hand board, int[][] rankCache)
public static Hand getBest5CardHand(Hand h)
h
- Any 7 card poker hand
public static int Find_Hand(int[] hand, int[] best)
public static final int rankHand_Java(Hand h)
h
- a 1-9 card hand
public static double ppot1(int c1, int c2, int[] bd, double[] weights, double[] result)
public static double ppot1(Card c1, Card c2, Hand bd, poker.ai.model.WeightTable wt)
public static double[] potential(Card c1, Card c2, Hand bd, poker.ai.model.WeightTable wt)
public static void test()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |