mainloop.java

来自「一个TSP问题的图形演示程序」· Java 代码 · 共 40 行

JAVA
40
字号
/* *  This code is from the book: * *    Winder, R and Roberts, G (2000) Developing Java *    Software, second edition, John Wiley & Sons. * *  It is copyright (c) 2000 Russel Winder and Graham Roberts. */package SimFrameWork ;/** *  This class implements the main control loop of a simulation *  which is run in a separate thread.  This allows the simulation *  to run independently of whatever else the rest of the program *  is doing. * *  @version 2.0 March 1999 *  @author Graham Roberts */public class MainLoop extends Control {  /**   *  Need a world object to run.   *   *  @param g grid to be run.   */  public MainLoop(Grid g) {    world = g ;  }  /**   *  Move simulation through next time step.   */  public void update() {    world.step() ;  }  /**   *  Reference to world being run.   */  private Grid world ;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?