示例#1
0
def simulation():
  centralClock = Clock(0)

  forcedDivergence = 150.0
  plant = DouadyCouderPlant(forcedDivergence, 5, 10, 10.0, 10.0)
  plant.addGrowthListener(GrowthListenerSupport(centralClock))
  centralClock.addTimeListener(plant)
  centralClock.suspended = 0
示例#2
0
def application():
  centralClock = Clock(0)

  plant = DouadyCouderPlant(150.0, 5, 10)

  plantViewer = PlantViewer(plant)
  centralClock.addTimeListener(plantViewer)

  #graphViewer = graph.GraphViewer("Energy Distribution", totalE0)
  #plant.addGrowthListener(graphViewer)

  divergenceViewer = graph.PlotterViewer("Divergence")
  plant.addGrowthListener(divergenceViewer)

  plantApplication = ViewerApplication("Douady and Couder's Sunflower", plantViewer)
  #plantApplication.addJInternalFrame(graphViewer)
  plantApplication.addJInternalFrame(divergenceViewer)
  plantApplication.addJInternalFrame(clock.ClockController(centralClock))