org.opensourcephysics.sip.ch19
Class GalaxyApp
java.lang.Object
org.opensourcephysics.controls.AbstractAnimation
org.opensourcephysics.controls.AbstractSimulation
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
| 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GalaxyApp
public GalaxyApp()
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)