edu.ucla.stat.SOCR.experiments
Class BallotExperiment
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.BallotExperiment
- 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 BallotExperiment
- extends Experiment
This class implements the classical ballot experiment: the winner has a
specified number of votes and the loser has a specified, smaller number of
votes. The votes are counted in a random order. The event of interest is that
the winner is always ahead in the vote count
Method Summary |
void |
doExperiment()
This method defines the experiment: the random walk is performed and the
ballot event is determined. |
void |
initialize()
used for some sublcass to initialize before be used |
void |
reset()
This method resets the experiment, including the record table, the ballot
graph, the random variable graph and table, and the indicator variable
for the ballot event. |
void |
setDistribution()
This method sets the parameters of the ballot graph and the distribution
of the indicator random variable. |
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 record table, the random variable graph and
table, and the ballot graph. |
void |
update(java.util.Observable o,
java.lang.Object arg)
|
Methods inherited from class edu.ucla.stat.SOCR.core.Experiment |
actionPerformed, getAppletInfo, getDisplayPane, getInstance, getName, getOnlineDescription, getResultTable, getStopChoice, getStopFreq, getTime, getUpdateChoice, graphUpdate, itemStateChanged, 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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BallotExperiment
public BallotExperiment()
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
doExperiment
public void doExperiment()
- This method defines the experiment: the random walk is performed and the
ballot event is determined.
- 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 record table, the ballot
graph, the random variable graph and table, and the indicator variable
for the ballot event.
- Specified by:
reset
in interface IExperiment
- Overrides:
reset
in class Experiment
update
public void update()
- This method updates the record table, the random variable graph and
table, and the ballot graph.
- Specified by:
update
in interface IExperiment
- Overrides:
update
in class Experiment
update
public void update(java.util.Observable o,
java.lang.Object arg)
- Specified by:
update
in interface java.util.Observer
- Overrides:
update
in class MultiplePartsPanel
setDistribution
public void setDistribution()
- This method sets the parameters of the ballot graph and the distribution
of the indicator random variable.