All Packages Class Hierarchy This Package Previous Next Index
Class com.lotspiech.poker.strategy.Strategy
java.lang.Object
|
+----com.lotspiech.poker.strategy.Strategy
- public class Strategy
- extends Object
- implements Serializable
This class calculates the optimal play, hand by hand, for a
given machine.
Copyright 2001, 2002 by Jeffrey B. Lotspiech. This program is open source;
it is licensed under the Common Public License Version 0.5.
- Author:
- Jeffrey B. Lotspiech
-
checkPointInterval
-
-
COPYRIGHT
-
-
count
-
-
hands
-
-
machine
-
-
serialVersionUID
-
-
Strategy()
- Strategy constructor comment.
-
Strategy(Machine, File)
- This calculates a strategy for a given game, checkpointing
the strategy in the given file.
-
calculateStrategy(File)
- This method was created in VisualAge.
-
dump(PrintWriter)
- This method was created in VisualAge.
-
getHands()
- This returns an Enumeration for this strategy's "registered hands".
-
getMachine()
- This method was created in VisualAge.
-
handCount(int, int, int, int, int)
- This method was created in VisualAge.
-
load(String)
- This loads a strategy from a file.
-
main(String[])
- This method was created in VisualAge.
-
nextSuit(int)
- This method was created in VisualAge.
-
readObject(ObjectInputStream)
- This method was created in VisualAge.
-
store(File)
- This method was created in VisualAge.
-
toString()
- This method was created in VisualAge.
-
writeObject(ObjectOutputStream)
- This method was created in VisualAge.
COPYRIGHT
private static final String COPYRIGHT
serialVersionUID
public static final long serialVersionUID
checkPointInterval
private static final int checkPointInterval
machine
private Machine machine
hands
private Vector hands
count
private int count
Strategy
public Strategy()
- Strategy constructor comment.
Strategy
public Strategy(Machine machine,
File file) throws Exception
- This calculates a strategy for a given game, checkpointing
the strategy in the given file. (It can take hours to
calculate a strategy.)
- Parameters:
- machine - com.lotspiech.poker.Machine
- file - A File object that will be the checkpoint file.
calculateStrategy
private double calculateStrategy(File file) throws Exception
- This method was created in VisualAge.
- Parameters:
- machine - com.lotspiech.poker.Machine
- Returns:
- double
dump
private void dump(PrintWriter out)
- This method was created in VisualAge.
- Parameters:
- out - java.io.PrintWriter
getHands
public Enumeration getHands()
- This returns an Enumeration for this strategy's "registered hands".
- Returns:
- java.util.Enumeration
getMachine
public Machine getMachine()
- This method was created in VisualAge.
- Returns:
- com.lotspiech.poker.Machine
handCount
private static int handCount(int i0,
int i1,
int i2,
int i3,
int i4)
- This method was created in VisualAge.
- Parameters:
- i0 - int
- i1 - int
- i2 - int
- i3 - int
- i4 - int
- Returns:
- int
load
public static final Strategy load(String filename) throws IOException, ClassNotFoundException
- This loads a strategy from a file.
- Parameters:
- filename - The name of the file.
- Returns:
- The strategy.
- Throws: IOException
- If an I/O error occurs.
main
public static void main(String args[]) throws Exception
- This method was created in VisualAge.
- Parameters:
- args - The arguments are: "name of machine"
nextSuit
private static final int nextSuit(int in)
- This method was created in VisualAge.
- Parameters:
- in - int
- Returns:
- int
readObject
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
- This method was created in VisualAge.
- Parameters:
- out - java.io.ObjectOutputStream
store
private void store(File file) throws IOException
- This method was created in VisualAge.
- Parameters:
- file - java.io.File
toString
public String toString()
- This method was created in VisualAge.
- Returns:
- java.lang.String
- Overrides:
- toString in class Object
writeObject
private void writeObject(ObjectOutputStream out) throws IOException
- This method was created in VisualAge.
- Parameters:
- out - java.io.ObjectOutputStream
All Packages Class Hierarchy This Package Previous Next Index