poker.ai
Class ProbTriple

java.lang.Object
  |
  +--poker.ai.ProbTriple

public class ProbTriple
extends java.lang.Object

The Probabiltiy Triple Generator. Stores a probability distribution for three parts for fold, call and raise.


Constructor Summary
ProbTriple()
          Default constructor.
ProbTriple(double f, double c, double r)
          Construct with the values given.
 
Method Summary
 void add(ProbTriple pt)
          Add the values of one triple into this one.
 void dotProduct(ProbTriple pt)
          Add the values of one triple into this one.
 double getCall()
           
 double getFold()
           
 double getRaise()
           
 double getValue(int action)
          Get the probability for an action
 void normalize()
          Normalize the values in the triple to sum to 1.0
 int select()
          Randomly select an action from the triple.
 int select(double spin)
          Select an action from the triple using the given spinner.
 int select(double spin, boolean useMax)
          Select an action from the triple distribution.
 int selectMax()
          Select the maximum value.
 int selectMax(double spin)
          Select the maximum value.
 void set(double f, double c, double r)
          Set the values given.
 void setCall(double c)
           
 void setFold(double f)
           
 void setRaise(double r)
           
 java.lang.String toString()
           
 boolean valid()
           
 void weight(double val)
          Multiply all entries by a constant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProbTriple

public ProbTriple()
Default constructor. Values all zero.

ProbTriple

public ProbTriple(double f,
                  double c,
                  double r)
Construct with the values given.
Parameters:
f - fold prob
c - call prob
r - raise prob
Method Detail

set

public void set(double f,
                double c,
                double r)
Set the values given.
Parameters:
f - fold prob
c - call prob
r - raise prob

getFold

public double getFold()

getCall

public double getCall()

getRaise

public double getRaise()

getValue

public double getValue(int action)
Get the probability for an action
Parameters:
action - FOLD/CALL/RAISE
Returns:
the appropriate probability of that action

normalize

public void normalize()
Normalize the values in the triple to sum to 1.0

valid

public boolean valid()

add

public void add(ProbTriple pt)
Add the values of one triple into this one.

dotProduct

public void dotProduct(ProbTriple pt)
Add the values of one triple into this one.

weight

public void weight(double val)
Multiply all entries by a constant.
Parameters:
val - to multiply the values.

setFold

public void setFold(double f)

setCall

public void setCall(double c)

setRaise

public void setRaise(double r)

select

public int select(double spin,
                  boolean useMax)
Select an action from the triple distribution.
Parameters:
spin - a random value indexing into the triple.
useMax - take one of the maximum values in the triple.

select

public int select(double spin)
Select an action from the triple using the given spinner.
Parameters:
spin - A random number between 0 and 1

selectMax

public int selectMax(double spin)
Select the maximum value.
Parameters:
spin - A random number between 0 and 1

selectMax

public int selectMax()
Select the maximum value.

select

public int select()
Randomly select an action from the triple.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object