startsimplebug.java~

来自「Swarm是一个非常有用的仿真工具」· JAVA~ 代码 · 共 42 行

JAVA~
42
字号
// StartSimpleBug.java// Java SimpleBug application. import swarm.Globals;import swarm.defobj.Zone;public class StartSimpleBug{    public static void main (String[] args)    {	ModelSwarm modelSwarm;	// Swarm initialization: all Swarm apps must call this first.	Globals.env.initSwarm ("SimpleBug", "2.1", 			       "bug-swarm@santafe.edu", args);	// Create a top-level Swarm object and build its internal	// objects and activities.  Note that we now use the Lisp	// Archiver to create modelSwarm and to load the model's	// parameters from a file.  The default filename is the	// name given by the first argument to initSwarm(), above,	// with the file extension .scm.  In this case that is	// SimpleBug.scm.        	// The second argument to getWithZone$key(), "modelSwarm", is	// the key in the .scm file which contains the class of the	// object to be created, ModelSwarm, and the values of the	// model parameters in the ModelSwarm class that we wish to	// set when the new object is created: worldXSize, worldYSize,	// seedProb, bugDensity and endTime.	modelSwarm = 	    (ModelSwarm)Globals.env.lispAppArchiver.getWithZone$key(				 Globals.env.globalZone, "modelSwarm");	modelSwarm.buildObjects();	modelSwarm.buildActions();	modelSwarm.activateIn(null);	// Now activate the swarm.	(modelSwarm.getActivity()).run();    }}

⌨️ 快捷键说明

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