📄 main.m
字号:
// Heatbugs application. Copyright (C) 1996-1999 Santa Fe Institute.// This library is distributed without any warranty; without even the// implied warranty of merchantability or fitness for a particular purpose.// See file LICENSE for details and terms of copying.#import <simtools.h> // initSwarm () and swarmGUIMode#import <simtoolsgui.h> // GUISwarm#import "ObserverSwarm.h"#import "BatchSwarm.h"// The main() function is the top-level place where everything starts.// For a typical Swarm simulation, in main() you create a toplevel// Swarm, let it build and activate, and set it to running.intmain (int argc, const char **argv){ id theTopLevelSwarm; // Swarm initialization: all Swarm apps must call this first.// initSwarmApp (argc, argv, "1.4.1", "bug-swarm@santafe.edu"); initSwarm (argc, argv); // swarmGUIMode is set in initSwarm(). It's set to be 0 if you // typed heatbugs -batchmode. Otherwise, it's set to 1. if (swarmGUIMode == 1) { // We've got graphics, so make a full ObserverSwarm to get GUI objects theTopLevelSwarm = [ObserverSwarm createBegin: globalZone]; SET_WINDOW_GEOMETRY_RECORD_NAME (theTopLevelSwarm); theTopLevelSwarm = [theTopLevelSwarm createEnd]; } else // No graphics - make a batchmode swarm and run it. theTopLevelSwarm = [BatchSwarm create: globalZone]; [theTopLevelSwarm buildObjects]; [theTopLevelSwarm buildActions]; [theTopLevelSwarm activateIn: nil]; [theTopLevelSwarm go]; // theTopLevelSwarm has finished processing, so it's time to quit. return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -