NetLogo Web is a version of the NetLogo modeling environment that runs entirely in the browser. One of the immediate goals of the project is to provide a suitable replacement for the NetLogo applet functionality, and, in doing so, once again make NetLogo models easy for users to put on the web for others to try. NetLogo Web runs on more platforms than Desktop NetLogo, including tablets, phones and Chromebooks. In the longer run, NetLogo Web will have most of the features of Desktop NetLogo.
The desktop edition of NetLogo is more polished and fully-featured than NetLogo Web. So, for now, we recommend using NetLogo Web only if one or more of the following describes your desired use of NetLogo:
- I want to use NetLogo on a platform that it does not otherwise run on (e.g., iPad, iPhone, Android, Chromebook)
- I want to embed a NetLogo model in a web page
- I want to distribute a NetLogo model without requiring my audience to have an existing NetLogo installation
The quality gap between NetLogo Web and NetLogo is fairly large right now, but we intend to greatly narrow that gap over the course of the coming years, prioritizing features that are important to large portions of the user community. Even if NetLogo Web doesn't meet all of your needs today, be sure to stay tuned as we work to improve NetLogo Web and expand its feature set.
- Most of the NetLogo programming language
- The Command Center
- Editable "Code" and "Info" tabs
- Authoring support
- The ability to export models for use in the desktop edition of NetLogo
- The ability to export models as standalone HTML pages
- High performance
- Many extensions, see the bundled extensions list to find out which extensions from desktop are supported.
- Reading from and writing to external files with the file primitives, but see the input and output extensions for an alternative method.
- 3D models and the "3D View" of 2D models
- Other less-central NetLogo features (e.g., System Dynamics Modeler)
- NetLogo language primitives relating to any of the above
- NetLogo language primitives relating to some kinds imports and exports
That said, there are very few things in NetLogo that have been left out of the long-term development plan for NetLogo Web. If support for your favorite primitive or feature is not currently available, it is likely forthcoming. We appreciate your patience as we work to reproduce functionality that has been developed and honed over more than fifteen years of NetLogo development, in our goal to make NetLogo Web the best product we can.
NetLogo Web opens with a randomly selected model. To load another model, you may select a model from the drop-down menu of models from the NetLogo Web Models Library (Search the Models Library) or use the button next to "Upload a Model" to open a Desktop NetLogo model of your own.
Most NetLogo library models work in NetLogo Web. In the NetLogo Web models library drop-down menu, models that work in NetLogo Web are selectable, whereas the models that don't yet work in NetLogo Web are grayed out. Some selectable models may not work exactly as their NetLogo counterparts. Some grayed out models can easily be modified in Desktop NetLogo so that they run in NetLogo Web.
To evaluate whether a model of your own will run in NetLogo Web today, you can use the "Upload a Model" button to open it in NetLogo Web. If the conversion process encounters an error, you will get feedback about what aspects of your model are not yet supported.
That said, here are some general rules for telling ahead of time whether or not a model will work in the current version of NetLogo Web:
- If your model only uses NetLogo features that are commonly used in the NetLogo Models Library, it is very likely that your model will work
- If your model uses unsupported extensions, file primitives, movie primitives, or any of the other currently-unimplemented primitives, it will not work
- If your model uses the
displayprimitives, it generally will not work
If you're still not sure if your model will work or not, we encourage you to simply open your model in NetLogo Web and see for yourself.
NetLogo Web is in continuous development. As NetLogo features are ported over to NetLogo Web, many models that previously could not be opened in NetLogo Web will automatically become runnable.
Click the "File: New" button in the top-right of any NetLogo Web model in order to open a fresh model.
For further information about NetLogo's authoring tools, please see "Authoring in NetLogo Web".
Firstly, the NetLogo Models Library is easily accessible in NetLogo Web. To open a model from the Models Library, simply select it in the "Search the Models Library" dropdown. In that dropdown, models that work in NetLogo Web are selectable, while models that don't work yet are grayed out.
The other option for opening models in NetLogo Web is to click the file-selection button labelled "Upload a Model", and then select a model on your computer. Note that opening a model in this way does not save your model remotely anywhere. In fact, the "Upload a Model" file picker simply asks your web browser to open a file from your computer in such a way that the model never even leaves your computer when it is "uploaded".
If you would like to save the model that is currently open in NetLogo Web (including any changes that you might have made to it), NetLogo Web offers two different ways of doing so.
If you would like to keep your model as a NetLogo Web model and share it with others to view in the browser, you can click the "Export: HTML" button in NetLogo Web to generate a single HTML file of your model. Like any other HTML file, files generated in this way can then be hosted on a website and viewed in any modern browser.
If you are interested in saving the model for use in the desktop version of NetLogo, the "Export: NetLogo" button can be used to do so. This will generate a traditional ".nlogo" file that has a name of your choosing, which will be placed in your computer's "downloads" directory and can then be opened once again in either NetLogo or NetLogo Web.
With a model downloaded from NetLogo Web, you can use the desktop version of NetLogo, make whatever changes to the model that you would like, save those changes, and then open the new version of the model in NetLogo Web (using "Upload a Model" in NetLogo Web, like before).
Unfortunately, free and simple-to-use hosting services are surprisingly few in number these days. We realize that this makes things difficult for many of our users, and we definitely plan to provide our own service that makes this easier for people in the future. For the time being, though, there are still a couple of options that we can suggest, based on what kind of files you would like hosted.
If you're just looking to host
.nlogo files, you can use
or basically any service that allows linking directly to hosted files.
.nlogo file has been hosted somewhere, follow
the page-generation instructions,
and share the
link, using the
.nlogo file URL from your hosting service as
Another option for linking directly to pages containing NetLogo Web models is to use the Modeling Commons, which is a public space for uploading, sharing, and discussing NetLogo models. All models uploaded to the Modeling Commons have integration with NetLogo Web through the "Run in NetLogo Web" tab on the model's page. For any model, if you open that "Run" tab and then copy your browser's current URL, that URL can be used for direct access to the NetLogo Web version of the model.
If you want to host an HTML standalone model (as generated by following the instructions in the section about "Export: HTML", then your options are more limited. One option is to use GitHub Pages, or some other static web host. Advanced users might even be comfortable with simply hosting the HTML files for themselves on a public-facing web server.
That said, hosting a
.nlogo file on your own web server is
more complicated, though. To do that, host the file, and make sure that
your web server allows it to be accessed cross-origin. To do this, you
might need to have the server set the
header in the
.nlogo file's HTTP response to either
or whichever NetLogo Web domain you're using (i.e.
Then, follow the instructions given here,
and share your model through the
link, using the URL of the model on the web server for the
You can link to
modelURL is the URL of your model). Every
time someone goes to that link (or an iframe is loaded that uses that link as
the source URL), the most recent version of your model will be fetched from
modelURL and turned into a simple model page.
While this generally should not be a problem, this method requires having an active connection to our website (netlogoweb.org) in order to work, unlike normal standalone NetLogo Web pages, which can be hosted entirely on your own server.
NetLogo does not store the speed slider setting with the model file, but NetLogo Web
provides a way to set the slider value on load using a URL query parameter. If
you are linking your model all you need to do is add
you are linking to the
//netlogoweb.org/web page you also will need
&url=modelURL instead of the plain
You can set the
speed value to any number between -1 (slowest) and 1
(fastest), and 0 is the default. Here are some examples, setting the speed to 0.5:
- If you're linking to
- If you're linking to
url=change for the
&between the parameters.
- If you're linking to an exported model HTML page,
If you enter code into the Command Center and that code is invalid in NetLogo Web, you will receive an error message, and your code may not get fully executed.
If you get an error when the model is first loaded up, but can't tell what's going wrong, it's probably because one of the widgets (e.g. a Plot or Slider) contains code that is currently invalid in NetLogo Web. The widget will not work correctly, but the parts of the model that did not generate errors will continue to be operable.
If you get an error only when you click a button, it usually suggests that the particular button contains code that is currently invalid in NetLogo Web. That button will be unusable, but the parts of the model that did not generate errors will continue to be operable.
A type error in general indicates that a function received one or more arguments
that it didn't know how to operate on. One example of a type error in NetLogo code would be
(turtle 0) + (turtle 1), since the
+ function doesn't know how to add
The area where NetLogo Web's error-reporting is poorest at the moment is in
ask n  (where
n is a number, or really anything but an agent or
ask were passed a literal value instead of a variable like
the compiler would usually just refuse to compile code that doesn't typecheck, and it would tell
you exactly what went wrong. Unfortunately, in NetLogo, static typechecking goes out the window
when variables are introduced, forcing the engine to fall back on runtime typechecking. Even more
unfortunately, NetLogo Web's runtime typechecking is very poor at the moment.
If the error message is "Models must have 12 sections, this had 1", the problem is likely that the uploaded file is not actually a NetLogo model. Please verify that you can open this file in the desktop version of NetLogo before proceeding.
If you got the "Couldn't find corresponding reader" error or the "Models must have 12 sections" error with a number at the end other than 1, this usually indicates an attempt to load a model that was saved in an old version of NetLogo. Please note that NetLogo Web only guarantees compatibility with the latest version of NetLogo.
The easiest way to fix this problem is to open the model in the latest version of NetLogo, allow NetLogo to automatically convert the old model, save the auto-converted model, and attempt to open the newly-converted version of the model in NetLogo Web.
If NetLogo Web complains that it cannot load this newly-converted model due to unimplemented primitives (especially those whose names start with underscores), you may need to slightly rewrite some of the code. See the NetLogo transition guide for more details on how to do that for the particular version of NetLogo that your model came from.
Your computer is working very hard to execute some NetLogo Web code. This is especially likely to occur when trying to do something that involves a very large number of agents. Unless you've done something to enter an infinite loop, we recommend just giving NetLogo Web some time to finish its task. If you have entered an infinite loop, the recommended solution is to terminate the browser tab.
A common NetLogo task is to run a procedure a number of times and then stop. This is easy to do by using code like:
repeat 10 [ go ] or
repeat 50 [ my-proc ]. In desktop NetLogo, if your procedure uses
tick, then the view will also update for each time the procedure is called. In NetLogo Web, however, no visual updates will happen until all repeats of the procedure are complete. This is due to technical limitations of the browser environment.
There is an easy workaround, it just requires a couple small changes to the model. Use a button in your model set to run forever and have that forever button run a repeat/count procedure. Inside that procedure, you can count ticks using a global variable and call
stop once you've reached your tick count limit. This will allow view updates to happen, run the required number of steps, and then stop execution as expected.
; this assumes you have a global variable, 'ticked', declared and set to 0 in 'setup' ; and a procedure named 'go' to run. Just run this proc in a forever button. to go-repeat set ticked (ticked + 1) go ; can change 100 to whatever number of ticks you'd prefer if (ticked > 100) [ ; resetting the ticked value before we stop lets people re-press the buttom ; to run another 100 ticks set ticked 0 stop ] end
There are a couple of reasons for this. One of the big ones is that the the desktop edition of NetLogo has about fifteen years of development work behind it, and a lot of that was spent on improving performance. With NetLogo Web, our foremost concern has been feature parity. NetLogo Web is still very young and has a lot of catching up to do, so we don't plan to focus hard on performance for a while yet.
We recommend first trying to solve the problem by refreshing the page. If that doesn't fix it, we encourage you to report your problem to us at firstname.lastname@example.org.
Like NetLogo, NetLogo Web is open-source and hosted on GitHub. The relevant repositories for the project are Galapagos (for the web interface), Tortoise (for the simulation engine and compiler back-end), and the Parser and Headless projects in NetLogo desktop (for the compiler front-end and the tests we use to verify feature parity between NetLogo Web and NetLogo desktop).
Pull requests to these repositories are welcome. If you would like to talk to any of the NetLogo team about some proposed changes of yours, feel free to drop by the relevant repository's chat room on Gitter, where we'll be glad to discuss things with you.
One important source of NetLogo Web's funding is generous community donations. If you're interested in making a donation to the NetLogo project, please visit our donation page here.
Above all else, we gratefully acknowledge that the National Science Foundation has been the primary funder of NetLogo Web (grant number IIS-1147621). We also appreciate the support from Concord Consortium.
NetLogo Web was also made by possible by building on top of the previous two decades of NetLogo funding. Much of the support over the years came from the National Science Foundation -- grant numbers REC-9814682 and REC-0126227, with further support from REC-0003285, REC-0115699, DRL-0196044, CCF-ITR-0326542, DRL-REC/ROLE-0440113, SBE-0624318, EEC-0648316, IIS-0713619, DRL-RED-9552950, DRL-REC-9632612, DRL-DRK12-1020101, IIS-1441552, CNS-1441016, CNS-1441041, IIS-1438813, and REC-1343873. Yet more support for NetLogo over the years was provided by the Spencer Foundation, Texas Instruments, the Brady Fund, and the Northwestern Institute on Complex Systems.
Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
For NetLogo or NetLogo Web feedback, please send email to email@example.com and for bug reports, please send email to firstname.lastname@example.org. We greatly value your comments, feature requests, observations, and bug reports. Please make sure to specify in your email that you are using NetLogo Web. You can also consult this page to determine where best to get in touch.