Class AizawaSimulation
java.lang.Object
edu.cnu.mdi.mdi3D.view3D.aizawaDemo.AizawaSimulation
- All Implemented Interfaces:
edu.cnu.mdi.sim.Simulation
Simulation wrapper for the Aizawa attractor demo.
This class contains no UI code. It is executed on the simulation thread by the MDI simulation engine.
The model owns the numerical state and update logic. This wrapper integrates that model into the simulation engine lifecycle.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault safety cap on the number of simulation updates. -
Constructor Summary
ConstructorsConstructorDescriptionAizawaSimulation(AizawaModel model) Construct a simulation for the given model. -
Method Summary
Modifier and TypeMethodDescriptiongetModel()Get the numerical model.voidinit(edu.cnu.mdi.sim.SimulationContext ctx) voidsetEngine(edu.cnu.mdi.sim.SimulationEngine engine) Attach the engine so this simulation can post messages and request refreshes.voidsetMaxSteps(int maxSteps) Set a safety cap on the number of simulation updates.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
-
Field Details
-
DEFAULT_MAX_STEPS
public static final int DEFAULT_MAX_STEPSDefault safety cap on the number of simulation updates.- See Also:
-
-
Constructor Details
-
AizawaSimulation
Construct a simulation for the given model.- Parameters:
model- the Aizawa model; must not be null
-
-
Method Details
-
getModel
Get the numerical model.- Returns:
- the model
-
setEngine
public void setEngine(edu.cnu.mdi.sim.SimulationEngine engine) Attach the engine so this simulation can post messages and request refreshes.- Parameters:
engine- the simulation engine, possibly null
-
setMaxSteps
public void setMaxSteps(int maxSteps) Set a safety cap on the number of simulation updates.- Parameters:
maxSteps- maximum number of updates; values less than 1 are promoted to 1
-
init
- Specified by:
initin interfaceedu.cnu.mdi.sim.Simulation- Throws:
Exception
-
step
- Specified by:
stepin interfaceedu.cnu.mdi.sim.Simulation- Throws:
Exception
-