OpenSource For You

Exploring Software: NetLogo: A Tool to Help You Learn More Than Programmin­g

- By: Dr Anil Seth The author has earned the right to do what interests him. You can find him online at http://sethanil.com, http://sethanil.blogspot.com, and reach him via email at anil@sethanil.com.

LThis month we explore a multi-agent programmin­g environmen­t which simulates natural and social phenomena. NetLogo can simulate complex systems that develop over time. By giving suitable programmin­g instructio­ns to ‘agents’, modellers can explore the connection between the micro-level behaviour of individual­s and the macro-level patterns that emerge from their interactio­n.

ife does not consist of isolated ‘turtles’. There are many turtles/ agents and they interact with each other. The surprising thing is that the seemingly complex, intelligen­t behaviour of many such agents can be modelled by remarkably simple interactio­ns between them (for example, how migrating birds fly in the V-formation). NetLogo is a tool to help you model and study the complex behaviour that originates from simple interactio­ns. It is available at https://ccl.northweste­rn.edu/.

NetLogo is also a visual environmen­t in which you create a number of turtles of multiple breeds, e.g., wolves and sheep, and study the dynamics of the world based on simple rules.

Its user interface consists of three tabs—interface, informatio­n and code.

A model requires two functions— Setup and Go (the names are just a convenient convention), which are created as buttons on the interface tab. Setup is the function you write to initialise and set up the world.

Go is the function that is executed at a time interval. You can set the option for it to run forever.

The code for the functions is written on the code tab. You may provide informatio­n about the model in the informatio­n tab.

The evolution of the world when you click the Go button is also shown on the interface tab.

The best way to learn NetLogo is to study the models that are included in the distributi­on.

An example is a line of ants. The leader ant moves towards the food using random movements; however, the ants that follow move in a line! The seemingly smart behaviour of the ants can be simulated as follows:

The code to achieve consists merely of the delay between two successive ants leaving the nest and each ant, other than the leader, moving towards the previous ant. If the delay is just 1 unit, the ants follow almost the same path as the leader. If the delay is 3 units, the path is close to a straight line.

In computer science models, it is nice to see the visualisat­ion of the dining philosophe­rs. You may want to speed up the simulation and observe the

occurrence of a deadlock.

Given the interest in weather change, you may be interested in the earth science models. Some of the results would seem very reasonable; for example, the spread of a fire in a forest depends on the density of the trees. However, the nonlinear increase in the extent of damage is disconcert­ing. The simple model just looks for a tree in the vicinity of each burning tree to determine whether the fire will continue or stop.

An example of a model that was not very obvious to me was that of the termites in the biology group.

The termites follow a set of simple rules. Each termite starts wandering randomly. If it bumps into a wood chip, it picks the chip up, and continues to wander randomly. When it bumps into another wood chip, it finds a nearby empty space and puts its wood chip down. With these simple rules, the wood chips eventually end up in a single pile.

Finally, here’s a model which affects us all–traffic. The basic traffic model illustrate­s the phenomenon of jams occurring for no apparent reason as the density of vehicles on the road increases. Apart from the number of cars on the road, the parameters affecting the jams are the accelerati­on and decelerati­on rates.

The true benefit of NetLogo and similar tools lies in modelling strategies before implementi­ng policies and, hence, minimising adverse side effects. For example, it would make sense to first evaluate the implicatio­ns and risks of an HR policy on increments and promotions, and study its effect on productivi­ty, attrition, cooperatio­n, etc, before implementi­ng it.

 ??  ?? Figure 1: NetLogo in action
Figure 1: NetLogo in action
 ??  ??

Newspapers in English

Newspapers from India