|
PokerSource Java API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.pokersource.enum.BeliefVector
Represents subjective beliefs about the possible hands held by a player. Maintains a mapping from each hand to its probability of occurrence.
Field Summary | |
private java.util.HashMap |
condHandProb
The belief probability (conditioned by dead cards) for each atomic starting hand. |
private long |
deadCards
The bitmask of dead cards. |
private java.util.HashMap |
groupProb
The belief probability (unconditioned by dead cards) of each hand group. |
private boolean |
hasAbsolute
|
private boolean |
hasRelative
|
private java.lang.String |
myspec
Our string representation, from the constructor. |
private java.util.HashMap |
uncondHandProb
The belief probability (unconditioned by dead cards) for each atomic starting hand. |
(package private) HandGroup |
universalGroup
The universe of all possible hands. |
Constructor Summary | |
BeliefVector(java.lang.String spec)
Instantiate self from string respresentation. |
Method Summary | |
private void |
addHandGroup(HandGroup group,
double prob)
|
(package private) void |
addHandGroupAbsolute(HandGroup group,
double absoluteProb)
During construction, add a new hand group with its absolute probability of occurrence. |
(package private) void |
addHandGroupRelative(HandGroup group,
double relativeProb)
During construction, add a new hand group with its probability of occurrence relative to the Bayesian probability. |
private void |
addRemaining(double prob)
|
(package private) void |
addRemainingAbsolute(double absoluteProb)
During construction, add each hand not yet added with the given absolute probability of occurrence of the entire set of such hands. |
(package private) void |
addRemainingRelative(double relativeProb)
During construction, add each hand not yet added with its probability of occurrence relative to its Bayesian probability. |
private void |
computeConditionedHandProb()
|
private void |
computeUnconditionedHandProb()
|
abstract void |
fromString(java.lang.String spec)
Instantiate self from string respresentation. |
double |
getBeliefProb(long hand)
Return the absolute probability that hand will occur, conditioned on the dead cards. |
long[] |
getHands()
Return an array of bitmasks representing hands with nonzero probability of occurring (conditioned on the dead cards). |
void |
setDeadCards(long cards)
Set the "dead cards", cards that are known not to be available. |
java.lang.String |
toString()
Generate string representation of self; the inverse of fromString(). |
java.lang.String |
toStringAtomic()
Generate a string representation of self that gives probability details for all atomic hands, conditioned on the dead cards. |
private double |
totalAbsoluteProb()
|
private double |
totalRelativeProb()
|
(package private) void |
validate()
After construction, subclasses should call this for a sanity check. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.lang.String myspec
HandGroup universalGroup
private java.util.HashMap groupProb
private long deadCards
private java.util.HashMap uncondHandProb
private java.util.HashMap condHandProb
private boolean hasRelative
private boolean hasAbsolute
Constructor Detail |
public BeliefVector(java.lang.String spec)
Method Detail |
public abstract void fromString(java.lang.String spec)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringAtomic()
public long[] getHands()
public double getBeliefProb(long hand)
private void computeConditionedHandProb()
private double totalRelativeProb()
private double totalAbsoluteProb()
private void computeUnconditionedHandProb()
public void setDeadCards(long cards)
private void addHandGroup(HandGroup group, double prob)
void addHandGroupRelative(HandGroup group, double relativeProb)
void addHandGroupAbsolute(HandGroup group, double absoluteProb)
private void addRemaining(double prob)
void addRemainingRelative(double relativeProb)
void addRemainingAbsolute(double absoluteProb)
void validate()
|
PokerSource Java API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |