org.opensourcephysics.sip.ch19
Class GalaxyApp

java.lang.Object
  extended by org.opensourcephysics.controls.AbstractAnimation
      extended by org.opensourcephysics.controls.AbstractSimulation
          extended by org.opensourcephysics.sip.ch19.GalaxyApp
All Implemented Interfaces:
java.lang.Runnable, Animation, Simulation, Drawable

public class GalaxyApp
extends AbstractSimulation
implements Drawable

GalaxyApp models evolution of a galaxy using percolation ideas Model proposed by Schulman and Seiden


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
GalaxyApp()
           
 
Method Summary
 int aForOtherRadius(int a, int r, int rOther)
           
 void createStars(int r, int a)
           
 void doStep()
          Does an animation step.
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Draws a representation of an object in a drawing panel.
 void formNewStars()
           
 void initialize()
          Initializes the simulation.
 void initializeGalaxy()
           
static void main(java.lang.String[] args)
           
 int pbc(int a, int r)
           
 void reset()
          Resets the simulation to its default state.
 
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

GalaxyApp

public GalaxyApp()
Method Detail

initialize

public void initialize()
Description copied from class: AbstractSimulation
Initializes the simulation. Override this method to initialize a concrete simulation.

Overrides:
initialize in class AbstractSimulation

initializeGalaxy

public void initializeGalaxy()

formNewStars

public void formNewStars()

pbc

public int pbc(int a,
               int r)

aForOtherRadius

public int aForOtherRadius(int a,
                           int r,
                           int rOther)

createStars

public void createStars(int r,
                        int a)

doStep

public void doStep()
Description copied from class: AbstractAnimation
Does an animation step.

Specified by:
doStep in class AbstractAnimation

reset

public void reset()
Description copied from class: AbstractSimulation
Resets the simulation to its default state. Override this method to set the simulation's parameters.

Overrides:
reset in class AbstractSimulation

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Description copied from interface: Drawable
Draws a representation of an object in a drawing panel.

Specified by:
draw in interface Drawable

main

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