Class KineticsSimulation
java.lang.Object
edu.cnu.mdi.mdi3D.view3D.kineticsDemo.KineticsSimulation
- All Implemented Interfaces:
edu.cnu.mdi.sim.Simulation
Simulation wrapper for the kinetic-gas demo.
This class contains no UI code. It is executed on the simulation thread by
SimulationEngine. Any UI updates must be requested through the engine
(SimulationEngine.requestRefresh(), SimulationEngine.postProgress(ProgressInfo), etc.).
-
Constructor Summary
ConstructorsConstructorDescriptionKineticsSimulation(KineticsModel model) Constructs a KineticsSimulation with the given model. -
Method Summary
Modifier and TypeMethodDescriptiongetModel()Returns the physics model.voidinit(edu.cnu.mdi.sim.SimulationContext ctx) voidsetEngine(edu.cnu.mdi.sim.SimulationEngine engine) Attach the engine so this simulation can post messages/progress/refresh.voidsetMaxSteps(int maxSteps) Set a safety cap on the number of steps.booleanstep(edu.cnu.mdi.sim.SimulationContext ctx) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.cnu.mdi.sim.Simulation
cancel, shutdown
-
Constructor Details
-
KineticsSimulation
Constructs a KineticsSimulation with the given model.- Parameters:
model- TheKineticsModelto use. Must not be null.
-
-
Method Details
-
getModel
Returns the physics model.- Returns:
- model (never null)
-
setEngine
public void setEngine(edu.cnu.mdi.sim.SimulationEngine engine) Attach the engine so this simulation can post messages/progress/refresh.Called by the hosting view after it constructs the
SimulationEngine.- Parameters:
engine- engine executing this simulation (may be null)
-
setMaxSteps
public void setMaxSteps(int maxSteps) Set a safety cap on the number of steps.- Parameters:
maxSteps- max steps (>= 1)
-
init
- Specified by:
initin interfaceedu.cnu.mdi.sim.Simulation- Throws:
Exception
-
step
- Specified by:
stepin interfaceedu.cnu.mdi.sim.Simulation- Throws:
Exception
-