Skip main navigation

Introduction to NetLogo

In this step we will introduce a simple tool that is used for creating and carrying out simulations called NetLogo.
Girl watching a computer screen

In this step, we will introduce a simple tool that is used for creating and carrying out simulations called NetLogo.

You have already seen that even with simple models of how individuals make decisions there are a lot of combinations that might be worth trying out and studying. When we want to study many individuals making decisions that influence each other a computer application is very useful. Here, we will be using such an application and it is worth underlining that for the purposes of this course you do not have to install anything in order to use it.

NetLogo is the name of a quite simple language with which we can build models. It is also the name of a platform where you can find many ready-made models, interact with them and analyse them. If you want to find out more about this language and the platform, you can read it on the NetLogo webpage.

For now, only a few mentions are important and useful.

In the image below you can see how a NetLogo simulation looks like. On the right hand side, you can see a space seen from a bird’s eye view, just like the one that illustrated the previous step. The red dot represents a colony of ants that forage for food. The blue circles represent the food sources. When ants in this simulation find food, they carry it to the nest dropping a chemical as they move and other ants can “sniff” the chemical and follow the trail.

ant model

There are some sliders on the screen of NetLogo simulations. For example, here you can use a slider to decide how many ants live in the simulated population, how fast they diffuse the chemical and how fast the chemical evaporates.

If you want to initiate the simulation you need to click on “setup”. That way you will get the initial state. Depending on the exact nature of what is simulated, every time you click “setup” you might get a somewhat different initial state because the exact parameters for the simulation can be selected randomly.

Pressing the “Go ↺” button once will start the simulation. The ants will leave the nest and search for food dropping the chemical on their way. How fast it will go depends on the position of the slider “model speed” at the top of the page just below the model title. If you press the “Go ↺” button again the simulation will pause.

In some simulations you will also find a “go-once” button that will run only one step (in language of models called iteration) of the simulation. If you press it again and again you will see more simulation steps and will be able to observe the dynamic of the process step by step at a pace of your choice.

In the model pages, you will always see a plot or several plots. For the ants model it will show you the amount of food in each pile. In the picture, you can see how the model looks after 200 iterations. In the plot you can see that up to iteration 100 the food piles where being used to a similar extent but after that one food pile became visibly more popular and has shrunken considerably more than the other two. It is the pile that is closest to the nest.

ant model

If you want to know the exact numbers for the plots you can position the cursor on the plot. The first number is the number of iterations. The second number is what is plotted on the vertical axis. In the ants simulation it is the amount of food left in a given pile. In our example, in the iteration 102 there is still 107 food pieces in the food pile number 2.

ant model

To sum up the general rules are that:

  • SETUP gives us “initial conditions”, that is a starting point.
  • GO ↺ will run our simulation until we click it again to make the process stop.
  • GO-ONCE starts the simulation and takes us one step ahead
  • a slider (for example: population) enables us to decide on some characteristics of the situation.
  • model speed sets up how fast the process unfolds
  • plot can help us track down how the process unfolds and what results we get

Now it’s time for you to try it out in the next steps.

Attention: we highly recommend that the next steps are done on a large screen, either a PC, laptop or a tablet at least, as the models will not be easy to operate on a phone. Furthermore, people who are colour-blind may find these exercises more difficult to do.

This article is from the free online

Decision Making in a Complex World: Using Computer Simulations to Understand Human Behaviour

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now