Class AizawaSimulation

java.lang.Object
edu.cnu.mdi.mdi3D.view3D.aizawaDemo.AizawaSimulation
All Implemented Interfaces:
edu.cnu.mdi.sim.Simulation

public class AizawaSimulation extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Default safety cap on the number of simulation updates.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a simulation for the given model.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the numerical model.
    void
    init(edu.cnu.mdi.sim.SimulationContext ctx)
     
    void
    setEngine(edu.cnu.mdi.sim.SimulationEngine engine)
    Attach the engine so this simulation can post messages and request refreshes.
    void
    setMaxSteps(int maxSteps)
    Set a safety cap on the number of simulation updates.
    boolean
    step(edu.cnu.mdi.sim.SimulationContext ctx)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface edu.cnu.mdi.sim.Simulation

    cancel, shutdown
  • Field Details

    • DEFAULT_MAX_STEPS

      public static final int DEFAULT_MAX_STEPS
      Default safety cap on the number of simulation updates.
      See Also:
  • Constructor Details

    • AizawaSimulation

      public AizawaSimulation(AizawaModel model)
      Construct a simulation for the given model.
      Parameters:
      model - the Aizawa model; must not be null
  • Method Details

    • getModel

      public AizawaModel 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

      public void init(edu.cnu.mdi.sim.SimulationContext ctx) throws Exception
      Specified by:
      init in interface edu.cnu.mdi.sim.Simulation
      Throws:
      Exception
    • step

      public boolean step(edu.cnu.mdi.sim.SimulationContext ctx) throws Exception
      Specified by:
      step in interface edu.cnu.mdi.sim.Simulation
      Throws:
      Exception