An introduction to Netlogo agentbased software Brian Dermody
An introduction to Netlogo agent-based software Brian Dermody
What is an agent? • An agent is an individual • Person, plant, electron etc. • It has attributes • Happy, wilted, charged etc. • It performs actions • Buy/sell, grow, radiate etc. • It exists in an environment • Market, ecosystem, atom etc. • Agents are often different • Interactions among agents and their environment bring about emergent behaviour/ patterns
Emergence • Small scale interactions among agents and their environment bring about higher-level emergent patterns • Simple – complex • Cross-scale feedbacks
Netlogo • Netlogo is the most widely used agent-based modelling environment in both education and research. • Netlogo is written mostly in Scala, an object-oriented language, with some parts in Java. • Netlogo consists of a Graphical User Interface (GUI) frontend with code on the backend. • GUI consists of buttons, sliders, graphs which can be linked with the code.
Netlogo • Netlogo is the most widely used agent-based modelling environment in both education and research. • Netlogo is written mostly in Scala, an object-oriented language, with some parts in Java. • Netlogo consists of a Graphical User Interface (GUI) frontend with code on the backend. • GUI consists of buttons, sliders, graphs which can be linked with the code. • Netlogo runs sequentially, parallel not possible: Disadvantage!
Netlogo • Agents (Turtles in Netlogo speak) interact with environment and each other • The environment comprises of patches • Grid-based data
Netlogo • Agents (Turtles in Netlogo speak) interact with environment and each other • The environment comprises of patches • Grid-based data • Supports multi-agent networks • Check model library for examples
Netlogo attributes • Global attributes are "global" because they are accessible by all agents and can be used anywhere in a model. • Agent/agent-set attributes: accessible by agents • Patch attributes: accessible by patches • Link attributes: accessible by links and node agents (for network models)
Tutorial 1. Go to uu. nl/clue and download the text file.
Tutorial 1. Open Netlogo and paste the provided code under the code tab 2. The model doesn’t work? – We need to provide links between frontend and the code
Tutorial 1. Open Netlogo and paste the provided code under the code tab 2. The model doesn’t work? – We need to provide links between frontend and the code 3. Use the check to see where the problems lie 4. You code relates to frontend controls such as buttons and sliders. You need to add these
Tutorial 1. Add a slider that allows you to flexibly set the number of “vulture” agents (min 0, max 50) 2. Add chooser for roost-dispersed (10, 50) 3. Add slider that allows you to flexibly set the number of “carcass” agents (min-0, max 50) 4. You need to add a “setup” and “go” buttons 5. Set go as “forever” 6. Change area of environment to 30*30 with patch size 10
Agent-based model of vulture foraging • Vultures • Vulture foraging • Vultures roost communally • • Scavengers Soaring flight Food is spatially and temporally ephemeral Large enough to feed more than one forager Food becomes easier to see when it is found by others Activity at the carcass Rapid descent of other vultures Research Questions • • What is the importance of the roost? Do vultures form groups? 14
Coordinated movement in animal groups Couzin et al. (2005) 15
Assignment 1. Add Zo. R, Zo. O and Zo. A sliders to the Netlogo frontend and link with code on coordinated movement (0 -5 with increment of 0. 1) 2. What type of coordinated movement do you see for different combinations of the 3 sliders?
Assignment 1. Add Zo. R, Zo. O and Zo. A sliders to the Netlogo frontend and link with code on coordinated movement 2. What type of coordinated movement do you see for different combinations of the 3 sliders?
More questions? • Netlogo dictionary • Simply right-click command • Netlogo models library • Adjust existing models to meet your needs • Netlogo user community forum • Usually answers within 1 day
- Slides: 18