edu.ucla.stat.SOCR.experiments
Class PokerExperiment
java.lang.Object
edu.ucla.stat.SOCR.core.SOCRValueSettable
edu.ucla.stat.SOCR.core.MultiplePartsPanel
edu.ucla.stat.SOCR.core.Experiment
edu.ucla.stat.SOCR.experiments.PokerExperiment
- All Implemented Interfaces:
- IExperiment, IValueSettable, Pluginable, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.lang.Runnable, java.util.EventListener, java.util.Observer
public class PokerExperiment
- extends Experiment
This class models the experiment of dealing a standard 5-card poker hand. The
random variable of interest is the type of hand: no value, one pair, two
pair, three of a kind, straight, flush, full house, four of a kind, straight
flush
Constructor Summary |
PokerExperiment()
This method initializes the experiment, including the cards, random
variable graph and table, and the record table |
Method Summary |
void |
doExperiment()
This method defines the experiment. |
int |
evaluateHand()
This method evalutes the type of hand: no value, one pair, two pair,
three of a kind, straight, flush, full house, four of a kind, or straight
flush. |
void |
itemStateChanged(java.awt.event.ItemEvent event)
This method overrides the corresponding method in Experiment, to
determine when stops occur automatically in run mode |
void |
reset()
This method resets the experiment, including the cards, the random
variable graph and table, and the record table |
void |
step()
This method runs the the experiment one time, and add sounds depending on
the outcome of the experiment. |
void |
update()
This method updates the display, including the cards, the random varaible
graph and table, and the record table |
Methods inherited from class edu.ucla.stat.SOCR.core.Experiment |
actionPerformed, getAppletInfo, getDisplayPane, getInstance, getName, getOnlineDescription, getResultTable, getStopChoice, getStopFreq, getTime, getUpdateChoice, graphUpdate, initialize, pasteData, resetUpdateCount, run, setShowModelDistribution, setStopFreq, setStopNow, stop |
Methods inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel |
addGraph, addTable, addTool, addTool2, addToolbar, format, getMainPanel, getRecordTable, getTextPanel, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, play, removeToolbar, setApplet, setName, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PokerExperiment
public PokerExperiment()
- This method initializes the experiment, including the cards, random
variable graph and table, and the record table
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent event)
- This method overrides the corresponding method in Experiment, to
determine when stops occur automatically in run mode
- Specified by:
itemStateChanged
in interface java.awt.event.ItemListener
- Overrides:
itemStateChanged
in class Experiment
doExperiment
public void doExperiment()
- This method defines the experiment. The 5 cards are dealt and the value
of the hand evaluated
- Specified by:
doExperiment
in interface IExperiment
- Overrides:
doExperiment
in class Experiment
step
public void step()
- This method runs the the experiment one time, and add sounds depending on
the outcome of the experiment.
- Specified by:
step
in interface IExperiment
- Overrides:
step
in class Experiment
reset
public void reset()
- This method resets the experiment, including the cards, the random
variable graph and table, and the record table
- Specified by:
reset
in interface IExperiment
- Overrides:
reset
in class Experiment
update
public void update()
- This method updates the display, including the cards, the random varaible
graph and table, and the record table
- Specified by:
update
in interface IExperiment
- Overrides:
update
in class Experiment
evaluateHand
public int evaluateHand()
- This method evalutes the type of hand: no value, one pair, two pair,
three of a kind, straight, flush, full house, four of a kind, or straight
flush.