edu.ucla.stat.SOCR.experiments
Class BertrandExperiment

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.BertrandExperiment
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 BertrandExperiment
extends Experiment

Betrand's experiment: Create a random chord on the unit circle and see if the lenght of this chord is longer thant the length of a side of the inscribed triangle.


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
MultiplePartsPanel.SOCRToolBar
 
Field Summary
static int UNIFORM_ANGLE
           
static int UNIFORM_DISTANCE
           
 
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
BertrandExperiment()
          Initialize the experiment: Set the name, add the toolbar with the model choices; add the floor graph and the random variable graph; add the record table and the random variable table
 
Method Summary
 void doExperiment()
          Perform the experiment: compute random distance or angle (depending on the model), compute the x and y coordinates of the chord
 void initialize()
          used for some sublcass to initialize before be used
 void itemStateChanged(java.awt.event.ItemEvent event)
          Determine which model is used: random distance or random angle
 void reset()
          Reset the experiment: record table, floor, random variable, random variable graph and table
 void step()
          Single step.
 void update()
          Update the display: record table, floor, 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, 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

UNIFORM_DISTANCE

public static final int UNIFORM_DISTANCE
See Also:
Constant Field Values

UNIFORM_ANGLE

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

BertrandExperiment

public BertrandExperiment()
Initialize the experiment: Set the name, add the toolbar with the model choices; add the floor graph and the random variable graph; add the record table and the random variable table

Method Detail

initialize

public void initialize()
Description copied from class: Experiment
used for some sublcass to initialize before be used

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

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent event)
Determine which model is used: random distance or random angle

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

doExperiment

public void doExperiment()
Perform the experiment: compute random distance or angle (depending on the model), compute the x and y coordinates of the chord

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

update

public void update()
Update the display: record table, floor, random variable graph and table

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

step

public void step()
Single step. Perform the experiment and add sounds

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

reset

public void reset()
Reset the experiment: record table, floor, random variable, random variable graph and table

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