org.opensourcephysics.sip.ch14.traffic
Class FreewayApp

java.lang.Object
  extended by org.opensourcephysics.controls.AbstractAnimation
      extended by org.opensourcephysics.controls.AbstractSimulation
          extended by org.opensourcephysics.sip.ch14.traffic.FreewayApp
All Implemented Interfaces:
java.lang.Runnable, Animation, Simulation

public class FreewayApp
extends AbstractSimulation

FreewayApp models traffic flow by showing the movement of the cars and a space-time diagram. Time is on the vertical axis and space on the horizontal axis.


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractSimulation
control, showStepsPerDisplay, stepCounter, stepsPerDisplay
 
Fields inherited from class org.opensourcephysics.controls.AbstractAnimation
animationThread, decimalFormat, delayTime, mainFrame
 
Constructor Summary
FreewayApp()
          Constructs the FreewayApp.
 
Method Summary
 void doStep()
          Does one iteration.
 void initialize()
          Initializes the animation using the values in the control.
static void main(java.lang.String[] args)
          Starts Java application.
 void reset()
          Resets animation to a predefined state.
 void resetAverages()
          Resets data without changing configuration
 
Methods inherited from class org.opensourcephysics.controls.AbstractSimulation
enableStepsPerDisplay, getControl, getLoader, getStepCounter, getStepsPerDisplay, initializeAnimation, resetAnimation, run, setControl, setStepsPerDisplay, start, startAnimation, startRunning, startSimulation, stepAnimation, stop, stopAnimation, stopRunning, stopSimulation
 
Methods inherited from class org.opensourcephysics.controls.AbstractAnimation
addChildFrame, clearChildFrames, getChildFrames, getDelayTime, getMainFrame, getOSPApp, isRunning, setDelayTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.controls.Simulation
isRunning
 

Constructor Detail

FreewayApp

public FreewayApp()
Constructs the FreewayApp.

Method Detail

initialize

public void initialize()
Initializes the animation using the values in the control.

Overrides:
initialize in class AbstractSimulation

doStep

public void doStep()
Does one iteration.

Specified by:
doStep in class AbstractAnimation

reset

public void reset()
Resets animation to a predefined state.

Overrides:
reset in class AbstractSimulation

resetAverages

public void resetAverages()
Resets data without changing configuration


main

public static void main(java.lang.String[] args)
Starts Java application.

Parameters:
args - command line parameters