Class NumerikApplet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by NumerikApplet
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible

public class NumerikApplet
extends java.applet.Applet
implements java.lang.Runnable, java.awt.event.ActionListener

This is the main class representing the traffic flow simulations. It has been written during a seminar held at Konstanz University. The literature for the algorithms in this applet has been "Numerical Methods for Conservation Laws" from R.J. LeVeque It contains the algorithm for solving the Burgers equation. The input data are read with the included get...-methods

See Also:
computation1(), getRed(), getGreen(), getRho(), Serialized Form
Author:
B. Düring, S. Holst

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 double green
           
static double h
           
static double k
           
static double l
           
static int N
           
static int phases
           
static double quot
           
 double red
           
 double rho
           
static double umax
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NumerikApplet()
          Constructor of the applet, sets the default values for the simulation parameters rho, green, red.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actionevent)
           
 void computation1()
          Perform the actual computations.
 double f(double d)
          The flux function f(u)=(1-u)u
 void init()
           
 void plot(double[] ad)
           
 double quotf(double d, double d1)
           
 void run()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

h

public static final double h
See Also:
Constant Field Values

N

public static final int N
See Also:
Constant Field Values

k

public static final double k
See Also:
Constant Field Values

umax

public static final double umax
See Also:
Constant Field Values

l

public static final double l
See Also:
Constant Field Values

quot

public static final double quot
See Also:
Constant Field Values

phases

public static int phases

rho

public double rho

green

public double green

red

public double red
Constructor Detail

NumerikApplet

public NumerikApplet()
Constructor of the applet, sets the default values for the simulation parameters rho, green, red. The components are added with the call to init()

See Also:
init()
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent actionevent)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

computation1

public final void computation1()
Perform the actual computations. Perhaps this method should be synchronized with event handling such that the computaiton process is not disturbed from parameter changes made in the meanwhile. This should only be a problem on very slow computers, as the computation on typical machines takes less than a second.

Numerically we use a Godunov scheme to optain sharp shock fronts.


f

public final double f(double d)
The flux function f(u)=(1-u)u

Parameters:
d - the actual value of the function u.
Returns:
the evaluation of the above function.

init

public void init()
Overrides:
init in class java.applet.Applet

plot

public void plot(double[] ad)

quotf

public final double quotf(double d,
                          double d1)

run

public void run()
Specified by:
run in interface java.lang.Runnable

start

public void start()
Overrides:
start in class java.applet.Applet

stop

public void stop()
Overrides:
stop in class java.applet.Applet