Feedback from users is very valuable to us in designing and improving NetLogo. We'd like to hear from you. Please send comments, suggestions, and questions to feedback@ccl.northwestern.edu, and bug reports to bugs@ccl.northwestern.edu.
General
Downloading
Usage
Programming
NetLogo is written entirely in Java (version 1.1).
How do I cite NetLogo in an academic publication?
NetLogo itself: Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
HubNet: Wilensky, U. & Stroup, W., 1999. HubNet. http://ccl.northwestern.edu/ps/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
How do I cite a model from the Models Library in an academic publication?
Wilensky, U. (year). Name of Model. URL of model. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
To determine the URL for a model, visit our web-based version of the Models Library and click on the name of the model. An example model URL is: http://ccl.northwestern.edu/netlogo/models/PepperedMoths.
To determine the year, open the model from the NetLogo application and look in the copyright information at the bottom of the Procedures tab.
What license is NetLogo released under? Are there are any legal restrictions on use, redistribution, etc.?
The NetLogo software, models and documentation are distributed free of charge for use by the public to explore and construct models. Permission to copy or modify the NetLogo software, models and documentation for educational and research purposes only and without fee is hereby granted, provided that this copyright notice and the original author's name appears on all copies and supporting documentation. For any other uses of this software, in original or modified form, including but not limited to distribution in whole or in part, specific prior permission must be obtained from Uri Wilensky. The software, models and documentation shall not be used, rewritten, or adapted as the basis of a commercial software or hardware product without first obtaining appropriate licenses from Uri Wilensky. We make no representations about the suitability of this software for any purpose. It is provided “as is” without express or implied warranty.
We are in the process of reevaluating the language of the license in response to user feedback. In the future, we intend to send out a revised license.
Is the source code to NetLogo available?
At present, no. We are evaluating how best to distribute NetLogo when it is in a more mature state. Making the source available is one possibility.
We do understand, however, that it is important that NetLogo not be a closed and non-extensible platform. That is not our intention for the product. For a future version of NetLogo, we plan to add an API so that users can add their own extensions to NetLogo. We'd like to work with interested users to help design this API to suit the needs of our user community.
Do you offer any workshops or other training opportunities for NetLogo?
We offer workshops from time to time. If a workshop has been scheduled, we will announce it on the NetLogo home page and on the netlogo-users group. If interested in this type of opportunity, please contact us at feedback@ccl.northwestern.edu if interested.
You should also check the NetLogo User Community Models section of our Models Library web page.
What's the difference between StarLogo, MacStarLogo, StarLogoT, and NetLogo?
The first version of StarLogo was developed at the MIT Media Lab in 1989–90. This original version ran on a massively parallel supercomputer called The Connection Machine. A few years later (1994), a simulated parallel version was developed for the Macintosh computer. That version eventually became MacStarLogo. The StarLogoT (1997) software, developed at the Center for Connected Learning and Computer-Based Modeling (CCL), is essentially an extended version of MacStarLogo with many additional features and capabilities.
Since then two multi-platform Java-based multi-agent Logos have been developed: NetLogo (from the CCL) and a Java-based version of StarLogo (from MIT).
The NetLogo language and environment differ in many respects from MIT StarLogo's. Both languages were inspired by the original StarLogo, but were redesigned in different ways. NetLogo's design was driven by the need to revise and expand the language so it is easier to use and more powerful, and by the need to support the HubNet architecture. NetLogo also incorporates almost all of the extended functionality of our earlier StarLogoT. See below for information on how to convert a StarLogoT model to NetLogo.
You can use the chart below to help familiarize yourself with the new features NetLogo has to offer.
StarLogoT | NetLogo | Features |
---|---|---|
X | X | Fully programmable |
X | X | Language is Logo dialect extended to support agents and parallelism |
X | X | Interface builder w/ buttons, sliders, switches, choices, monitors, and text boxes |
X | X | Info area for annotating your model |
X | X | Powerful and flexible plotting system |
X | X | Agent Monitors for inspecting agents |
X | X | Export and import model function (save and restore state of model) |
X | Cross-platform: runs on MacOS, Windows, Linux, et al | |
X | Models can be saved as applets to be embedded in a web page | |
X | Unlimited numbers of agents and variables | |
X | Double precision arithmetic | |
X | Simplified language structure | |
X | “Agentsets” make many programming tasks easier | |
X | Syntax-highlighting code editor | |
X | Rotatable and scalable vector turtle shapes | |
X | Exact on-screen turtle positioning | |
X | Redesigned user interface | |
X | Text labels for turtles and patches | |
X | New primitives | |
X | BehaviorSpace: a tool used to collect data from multiple runs of a model | |
X | HubNet: participatory simulations using networked devices | |
X | Converts StarLogoT models into NetLogo models |
Has anyone written a model of <x>?
The best place to ask this question is on the NetLogo Users Group.
Are NetLogo models runs scientifically reproducible?
Yes, with the following cautions:
The download form doesn't work for me. Can I have a direct link to the software?
Please write us at bugs@ccl.northwestern.edu and we'll either fix the problem with the form, or provide you with an alternate method of downloading the software.
Downloading NetLogo takes too long. Is it available any other way, such as on a CD?
At present, no. If this is a problem for you, contact us at feedback@ccl.northwestern.edu.
I downloaded and installed NetLogo but the Models Library has few or no models in it. How can I fix this?
So far, users reporting this problem all used the “without VM” download option for Windows. Uninstall NetLogo and try the “with VM” download instead.
Even if the “with VM” download fixes it for you, please contact us at bugs@ccl.northwestern.edu so we can find out more details about your setup. We'd like to fix this in a future version, but to troubleshoot it we need help from users.
Can I have multiple versions of NetLogo installed at the same time?
Yes. When you install NetLogo, the folder that is created contains has the version number in its name, so multiple versions can coexist.
On Windows systems, whichever version you installed last will be the version that opens when you double click a model file in Windows Explorer. On Mac OS 9, it's unpredictable what version opens. On Mac OS X, you can control it via “Get Info” in the Finder.
How do I change how many patches there are?
Select the Graphics Window by dragging a rectangle around it with the mouse. Click the “Edit” button in the Toolbar and type in new values for “Screen Edge X” and “Screen Edge Y”. (You can also right-click [Windows] or control-click [Mac] on the Graphics Window to edit it, or select it then double-click.)
How big can my model be? How many turtles, patches, procedures, buttons, and so on can my model contain?
The NetLogo engine has no fixed limits on size.
By default, though, on non-Macintosh operating systems NetLogo ships with a 512 megabyte ceiling on how much total RAM your model can use. But you can raise that limit by editing this section of the “NetLogo.lax” file in the NetLogo folder:
# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX # ------------------------------------- # allow the heap to get huge lax.nl.java.option.java.heap.size.max=536870912
If you are running NetLogo on Mac OS X in the Classic environment, then your model can't use more than 100MB of RAM. (If you are also running other applications in the Classic at the same time, then the ceiling may be lower.) This is due a limitation of the Classic environment itself. If you need to run very large models on Mac OS X, then you should use the native application, not the Classic application.
We have tested NetLogo with models that use hundreds of megabytes of RAM and they work fine. We haven't tested models that use gigabytes of RAM, though. It should work, but eventually perhaps you might hit some limits that are inherent in the underlying Java VM virtual machine and/or operating system (either built-in limits, or just bugs related to extremely high memory use).
Can I import a graphic into NetLogo?
At present, no. We plan to add this capability in a future version.
My model runs slowly. How can I speed it up?
Here's some ways to make it run faster without changing the code:
In many cases, though, if you want your model to run faster, you may need to make some changes to the code. Usually the most obvious opportunity for speedup is that you’re doing too many computations that involve all the turtles or all the patches. Often this can be reduced by reworking the model so that it does less computation per time step. If you need help with this, if you contact us at feedback@ccl.northwestern.edu we may be able to help if you can send us your model or give us some idea of how it works. The members of the NetLogo Users Group may be able to help as well.
Currently, there are two implementations of HubNet. One uses Texas Instruments’ calculators and requires Texas Instruments’ calculator network system, called TI-Navigator. The other uses networked computers and does not require the TI-Navigator system.
TI recently announced that TI-Navigator is commercially available. However, HubNet does not work with this version of TI-Navigator; it might only work with a future released version of TI-Navigator.
The other implementation of HubNet is included in the NetLogo download and can be used without additional materials. Please refer to the HubNet Guide for more information on this version of HubNet.
Can I run a NetLogo model from the command line? Can I run it without a GUI?
At present there is no way to run without the GUI. We plan to add this in a future version. (On X11-based systems such as Linux, though, one possible solution to use X11’s “virtual frame buffer” feature, which provides a virtual display for NetLogo to run on.)
Automating runs from the command line is possible, but currently not officially supported or documented. If you need this for your work, it can be done, but some light Java programming is required. We can supply sample Java code that you can alter for your needs. Anyone interested in doing this, write us at feedback@ccl.northwestern.edu.
Can I have more than one model open at a time?
One instance of NetLogo can only have one model open at a time. (We plan to change this in a future version.)
You can have multiple models open by opening multiple instances of NetLogo, though. On Windows and Linux, simply start the application again. On Macs, you’ll need to duplicate the application in the Finder, then open the copy. (This will use only a very small amount of additional disk space, since most of NetLogo is actually in the NetLogo.jar file, which is stored outside the application.)
Can I copy or save a picture of the graphics window?
NetLogo itself does not have this capability presently, but you can use the screen-capture capabilities of your operating system, or a third-party screen-capture package, to do this.
Can I make a movie of my model?
NetLogo itself does not have this capability presently, but there are many third-party software packages that let you capture movies from any running application.
How is the NetLogo language different from the StarLogoT language? How do I convert my StarLogoT model to NetLogo?
We don’t have a document that specifically summarizes the differences between these two programs. If you have built models in StarLogoT before, then we suggest reading the Programming Guide section of this manual to learn about NetLogo, particularly the sections on “Ask” and “Agentsets”. Looking at some of the sample models and code examples in the Models Library may help as well.
If you need any help converting your StarLogo or StarLogoT model to NetLogo, please feel free to get in touch with us at feedback@ccl.northwestern.edu. The NetLogo Users Group is also a good resource for getting help from other users.
The NetLogo world is a torus, that is, the edges of the screen are connected to each other, so turtles and patches “wrap around”. Can I use a different world topology: bounded, infinite plane, sphere, etc.?
Torus is the only topology directly supported by NetLogo, but you can often simulate a different topology without too much extra effort.
If you want the world to be a bounded rectangle, you may need to add some code to your model to enforce this. Often a helpful technique is to turn the edge patches a different color, so turtles can easily detect when they “hit” the edge. Also, there are “no-wrap” versions of the “distance” and “towards” primitives; these should help.
If you want your turtles to move over an infinite plane, you can simulate this by having the turtles keep track of their position on the infinite plane, then hide the turtle when it goes “out of bounds”. The Random Walk 360 model in the Models Library shows you how to code this.
Simulating a spherical or other topology might be difficult; we haven’t seen a model that does this. (If you have one, please send it in!)
Does NetLogo have a command like StarLogo’s “grab” command?
We don’t have such a command, although we plan to add one—or perhaps several! In the meantime, though, you can use the without-interruption primitive to arrange exclusive interaction between agents. For example:
turtles-own [mate] to setup ask turtles [ set mate nobody ] end to find-mate ;; turtle procedure locals [candidate] without-interruption [ if mate = nobody [ set candidate random-one-of other-turtles-here with [mate = nobody] if candidate != nobody [ set mate candidate set mate-of candidate self ] ] ] end
Using without-interruption ensures that while a turtle is choosing a mate, all other agents are “frozen”. This makes it impossible for two turtles to choose the same mate.
I tried to put -at after the name of a variable, for example variable-at -1 0, but NetLogo won’t let me. Why not?
This syntax was supported by StarLogoT and some beta versions of NetLogo, but was removed from NetLogo 1.0. Instead, for a patch variable write e.g. pcolor-of patch-at -1 0, and for a turtle variable write e.g. color-of one-of turtles-at -1 0.
I’m getting numbers like 0.10000000004 and 0.799999999999 instead of 0.1 and 0.8. Why?
That math operations sometimes produce slightly inaccurate results like these is a limitation of IEEE floating point arithmetic in general. (NetLogo uses Java to do math, and Java implements the IEEE standard.) But there are some cases where NetLogo should compensate for it and doesn’t. We fix them as we find them (or you report them), but in general, you shouldn’t expect floating point arithmetic to produce absolutely exact answers.
The “precision” primitive is handy for rounding off numbers for display purposes.
If you encounter a specific instance of this problem and are not sure whether it’s an issue with NetLogo or an issue with floating point arithmetic in general, run it by us and we’ll take a look.
NetLogo 1.3 includes undocumented, experimental support for reading and writing arbitrary data to and from files. See http://groups.yahoo.com/group/netlogo-users/message/619 for a detailed description. We expect that the next major release of NetLogo will include a finished version of this facility. If you have any feedback about the experimental version, please write us at feedback@ccl.northwestern.edu.
If you don't use the experimental primitives, then here are two other possible methods for getting external data into your model:
1) Copy and paste the data into the Procedures window, store it in a variable, and then work with it from there.
2) Use “Import World” to import the data. This will require modifying your data to be in the format that import-world expects. You can use “Export World” to produce an example of the format, and then use that as a template.
NetLogo currently has four mechanisms for this:
How can I keep two turtles from occupying the same patch?
How to best accomplish this depends somewhat on the details of how your model works. The following techniques may be helpful:
Sometimes code that looks like it should prevent two turtles from ever being on the same patch can fail because of unexpected interactions between the turtles as they all execute the code in parallel. In these situations, appropriate use of without-interruption can be helpful.
How can I use different patch “neighborhoods” (circular, Von Neumann, Moore, etc.)?
The in-radius primitives lets you access circular neighborhoods of any radius.
The neighbors primitive gives you a Moore neighborhood of radius 1, and the neighbors4 primitive gives you a Von Neumann neighborhood of radius 1.
If you want a Moore or Von Neumann neighborhood of a different radius, or a different kind of neighborhood altogether, you can define it yourself, using the at-points primitive and/or other techniques. If the neighborhoods do not change over time, then the most efficient way to use them is to compute the neighborhoods only once, ahead of time, and store them in agentsets. See this URL for a discussion and example code: http://groups.yahoo.com/group/netlogo-users/message/377.
Can I connect turtles with lines, to indicate connections between them?
Eventually we plan to support this directly but in the meantime there are various workarounds you can use. See this URL for a discussion and example code: http://groups.yahoo.com/group/netlogo-users/message/324.
How does NetLogo decide when to switch from agent to agent when running code?
Turtles are scheduled for execution in ascending order by ID number. Patches are scheduled for execution by row: left to right within each row, and starting with the top row. In a future version of NetLogo, we plan to add an option for randomized scheduling.
Once scheduled, an agent’s “turn” ends only once it performs an action that affects the state of the world, such as moving, or creating a turtle, or changing the value of an agent variable. (Setting a local variable doesn’t count.)
To prolong an agent’s “turn”, use the without-interruption command.
In general, we suggest you write your NetLogo code so that it does not depend on a particular scheduling mechanism. We make no guarantees that the scheduling algorithm will remain the same in future versions.