First Steps with NetLogo

0 views
Skip to first unread message

forcode(奇想录)

unread,
Jan 7, 2008, 10:22:07 AM1/7/08
to as

First Steps with NetLogo

Lets take a few first steps with our modeling frameworks.  We will be fairly brief , limiting ourselves to simple "kicking the tires" and writing a hello world in each ABM system (here is the RePast First Steps).  Our goal is to gain a feel for what each system is capable of so that we can make intelligent decisions on which one to use for a given task.  Note: most images below can be clicked on for a full size image.

Introducing NetLogo

To download NetLogo, go to their web site, downloading the package for your system.  As of this writing, the version is 1.2.  During the download you can join the mail list, which I recommend. 

The package will include considerable browser-based documentation in the docs/ directory for fast viewing.  I show the results of downloading "Other Java-enabled platform" to the right.  The NetLogo.jar is double clickable, starting the application.  Specific downloads are available for Mac and Windows.

The NetLogoLite.jar file is used for exporting your models to the web, like this example.




When NetLogo starts, you are presented with an empty model, left, which you can modify.  You also can browse the Model Library, right. Start by selecting the Segregation model from the Social Science collection. 

To run the model, click "Setup", then "go".  The model runs until each agent (called turtles) is "satisfied" .. i.e. has neighbors of at least "%-similar-wanted" as himself.   You can experiment with number of turtles and the % setting by changing the sliders.



Note the surprising result with the initial settings: wanting 30% similar neighbors generally results in over 70% similar!  This suggests very minor desire for similarity among residents of a neighborhood results in segregation.  Click on the tabs on the top of the window to see more information about the model, and to see the source code itself.  The code is surprisingly simple for what it does.

Now lets try a few simple commands.  To do this, we'll select New in the File menu to get an empty new model.  This presents just two items: the graphics window and the command center.  The graphics window shows the patches and turtles, while the command center lets you type in commands, helpful for experimenting to see how they work.

Kicking The Tires: The Command Center

The command center accepts commands in three contexts: commands for the global Observer, or for commands sent t

Reply all
Reply to author
Forward
0 new messages