edu.ucla.stat.SOCR.experiments
Class RouletteExperiment

java.lang.Object
  extended by edu.ucla.stat.SOCR.core.SOCRValueSettable
      extended by edu.ucla.stat.SOCR.core.MultiplePartsPanel
          extended by edu.ucla.stat.SOCR.core.Experiment
              extended by edu.ucla.stat.SOCR.experiments.RouletteExperiment
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 RouletteExperiment
extends Experiment

This class models the casino roulette experiment.


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
MultiplePartsPanel.SOCRToolBar
 
Field Summary
static int EIGHTEEN
           
static int FOUR
           
static int ONE
           
static int SIX
           
static int THREE
           
static int TWELVE
           
static int TWO
           
 
Fields inherited from class edu.ucla.stat.SOCR.core.Experiment
showModelDistribution
 
Fields inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
applet, fName, graphs, mainPane, recordTable, tables, toolbar, toolbar2, toolbars
 
Constructor Summary
RouletteExperiment()
          This method initializes the experiment by setting up the toolbar with the bet choice, and initializing the roulette wheel.
 
Method Summary
 void doExperiment()
          This method defines the exeperiment.
 void itemStateChanged(java.awt.event.ItemEvent event)
          This method sets the distribution when the bet has changed.
 void reset()
          This method resets the experiment, including the roulette wheel, the random variable graph and table, and the record table.
 void step()
          This method runs the experiment one time and then plays a sound, depending on the outcome.
 void update()
          This method updates the experiment, including the roulette wheel, the record table and the random variable graph and 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 edu.ucla.stat.SOCR.core.SOCRValueSettable
createComponentSetter, createValueSetter, createValueSetter, createValueSetter, createValueSetter, getComponentSetter, getComponentSetters, getValueSetter, getValueSetters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.ucla.stat.SOCR.core.Pluginable
setApplet
 

Field Detail

ONE

public static final int ONE
See Also:
Constant Field Values

TWO

public static final int TWO
See Also:
Constant Field Values

THREE

public static final int THREE
See Also:
Constant Field Values

FOUR

public static final int FOUR
See Also:
Constant Field Values

SIX

public static final int SIX
See Also:
Constant Field Values

TWELVE

public static final int TWELVE
See Also:
Constant Field Values

EIGHTEEN

public static final int EIGHTEEN
See Also:
Constant Field Values
Constructor Detail

RouletteExperiment

public RouletteExperiment()
This method initializes the experiment by setting up the toolbar with the bet choice, and initializing the roulette wheel.

Method Detail

doExperiment

public void doExperiment()
This method defines the exeperiment. The wheel is spun and the result of the bet determined.

Specified by:
doExperiment in interface IExperiment
Overrides:
doExperiment in class Experiment

reset

public void reset()
This method resets the experiment, including the roulette wheel, 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 experiment, including the roulette wheel, the record table and the random variable graph and table.

Specified by:
update in interface IExperiment
Overrides:
update in class Experiment

step

public void step()
This method runs the experiment one time and then plays a sound, depending on the outcome.

Specified by:
step in interface IExperiment
Overrides:
step in class Experiment

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent event)
This method sets the distribution when the bet has changed.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Overrides:
itemStateChanged in class Experiment