Agent Directed Simulation in NetLogo - Artificial Intelligence

NetLogo uses an approach that is different to the classical logic-based approach that agent-oriented programming languages and frameworks usually take. It illustrates the power of the agent-oriented approach at tackling problems in a non-traditional way, and has the potential for overcoming some of the barriers to developing useful multi-agent systems.

NetLogo,first designed by Uri Wilensky in 1999,is a cross-platform multi-agent programmable modelling environment under continuous development at the CCL (Centre for Connected Learning and Computer-based Modelling) at Northwestern University.

NetLogo can be used for the rapid prototyping of simulations of natural and social phenomena.It is based on an earlier graphics-oriented language called Logo developed by Seymour Papert in the 1960s and is distinguished from the more traditional agent-oriented programming languages in that it does not support logic-based formalisms.NetLogo adopts an event-driven architecture where agents with simple reactive behaviours can yield astonishingly complex simulations despite being situated in a limited two-dimensional (2D) grid environment (a version with a 3D grid environment is currently under development). NetLogo describes the environment it uses for visualizing its simulations as a ‘world’ (in other words, it making an analogy between its environment and the real world).

This world is made up of ‘agents’ that perform activities by following instructions specified by methods programmed in the NetLogo programming language.These activities are carried out simultaneously for all agents in the world. NetLogo has four types of agents: turtles, patches, links and the observer. Turtles are agents that move around and interact with the world. The reason they are called turtles has been inherited from the Logo programming language – the analogy is of an imaginary robotic turtle that has the ability to move around and to lift or drop a virtual coloured drawing pen it has on its back onto a drawing canvas. The 2D grid is also made up of patches that are square pieces of land that the turtles can move over, and move around (see right box in Figure below).

Links are agents that connect two turtles together. The observer looks out over the world of turtles and patches but does not have a specific location (in some sense it is not embodied like the other agents).

Figure Screenshot of the Wolf Sheep Predation model in NetLogo.

Screenshot of the Wolf Sheep Predation model in NetLogo

NetLogo comes with a rich set of sample ‘models’ (or programs) that are simulations of natural or social phenomena in a number of areas such as: art, biology, chemistry & physics, computer science, earth science, mathematics, and social science. For example, the Wolf Sheep Predation model explores the stability of predator-prey ecosystems.In the simulation, there are two types of breeds (distinct types of turtle agents) – wolves and sheep, as well as grass patches.The wolves eat the sheep and the sheep eat the grass. Depending on the start-up conditions (number of wolves, number of sheep, reproduction-rates of wolves and sheep,how much energy they gain from eating, where they are randomly located in the environment, and grass re-growth time), the simulation will result in an unstable system where either the wolves or both the wolves and sheep become extinct, or it will result in a stable system where it will tend to maintain itself despite fluctuations in population sizes over time.A screenshot of the model is shown in Figure above.

NetLogo code is very readable,and compact.Listed below is the code for the main go procedure that specifies what happens when the Wolf Sheep Predation simulation is run.

NetLogo Code : Main go procedure for the Wolf Sheep Predation model in NetLogo.

The ask command is used to specify the behaviour of the turtle agents, patches and links. In the code above,the behaviour of the sheep is first to move,then to eat grass,reproduce and die.The behaviour of the wolves is to move,catch sheep (and eat them), reproduce then die.

The many varied models that come with NetLogo illustrate that the agent-oriented programming paradigm it adopts is adept at modelling a surprising range of phenomena in a non-complicated way.For example, Figure below shows the Tumor model that simulates the growth of a tumour and how it resists chemical treatment.A tumour consists of two kinds of cells: stem cells represented by blue turtle agents; and transitory cells represented by all other turtles.The figure illustrates how the cell advances into distant sites and how it creates another tumour colony, a process called metastasis shown in red.

Screenshot of Tumor model in NetLogo.

Screenshot of Tumor model in NetLogo

NetLogo is an excellent tool for illustrating the principle that complexity can arise from the interaction of agents who individually apply simple reactive behaviours,but collectively, exhibit much more–that is,the system as a whole is greater than the sum of its parts. Throughout these books,we will look at sample code in NetLogo to show how various aspects of agent-oriented systems can be implemented.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Artificial Intelligence Topics