Contents:
- Introduction
- Conway's Game of Life
- Schelling's Segregation Model
- Pedestrian Evacuation Model
- Download the paper
Introduction
This micro-site contains information pertaining to the development of three agent based models in Second Life and complements the paper "Agent Street: An Environment for Exploring Agent-Based Models in Second Life". We describe the inner workings of the models along with providing the Linden Script code listings so that readers can recreate the models themselves. Movies on each page show the models running and demonstrate Second Life's potential for outreach and communication of agent-based models.
The original page can be found here: http://www.casa.ucl.ac.uk/abm/secondlife/
Below are two movies to give an overview of Agent Street
Agent-Street Vending Machines
Overview Movie of Agent-Street
Conway's Game of Life
Introduction:
This model is a recreation of Conway's very well known Game of Life where cells in a square grid live or die depending on the number of neighbors they have. Wikipedia has a page detailing the model here. This is the most basic of the three models and we used this to look at the suitability of Second Life as a platform for developing agent based models.
As with all the models we have tried to visualize as much of the inner workings of the model as possible so the "thinking" and "acting" states have different colors and the number of neighbors each cell has is displayed above it so that users can get an insight into how the model works.
Example Run Movie:
- The movie below shows the model running:
Game of Life movie
Technical Details:
A PDF document containing details about how the model was implemented is available to download:
Source Code:
The Linden Scripts for this model are covered by the GNU GENERAL PUBLIC LICENSE and are available to download below:
The Linden Scripts for this model are covered by the GNU GENERAL PUBLIC LICENSE and are available to download below:
If you prefer to get up and running more quickly we have a vending machine on Nature island that will give you a complete working copy of the model when you click on it. The SLURL below will take you straight there (this is now depreciated):
Extending the Model:
A three-dimensional version of the game of life is possible using these blocks if you stack layers of them, though it obviously behaves differently and you may need to change the neighbor thresholds that decide when a block lives or dies.
Schelling's Segregation Model
Introduction:
The second model we looked at was Thomas Schelling's model of urban segregation. Schelling originally demonstrated the concept with coins on a chess board. We have transferred the ideas into Second Life and instead use colored spheres inside a grid of houses.
![]() |
Our segregation model grid |
The spheres take it in turns to move. They glow to indicate who is thinking and if unhappy they float above the board and then choose a new house. A happy agent is large and an unhappy agent is small.
Graph:
In an attempt to validate the model we provide a graph in Second Life that shows the number of happy agents of each type after each iteration of the model.
![]() |
Graph showing number of happy blue and red agents at each iteration |
Example Run Movie:
- The movie below shows one complete run of the model and demonstrates how segregation emerges:
Technical Details:
A PDF document containing details about how the model was implemented is available to download:
Source Code:
The Linden Scripts for this model are covered by the GNU GENERAL PUBLIC LICENSE and are available to download below:
If you prefer to get up and running more quickly we have a vending machine on nature island here that will give you a complete working copy of the model when you click on it (this is now depreciated).
Pedestrian Evacuation Model
Introduction:
The last model we developed in Second Life was a pedestrian evacuation model. This is a much more accurate simulation of real life than the previous two models and the rules that govern the agents are a lot more complicated.
The model was designed and developed by Joel Dearden based on ideas from Andrew Crooks and Andrew Hudson-Smith.
Basic Concept Model:
We started out by building a much simpler model to investigate how pedestrian behaviour could be simulated in Second Life. The agents in this model represent people wandering around a room and this forms the idea for the initial part of the final model where pedestrians wander around a room until the fire alarm goes off.
Evacuation Model Detail:
The final version of the model simulates a pedestrian evacuation in response to a fire alarm, from the time before the alarm is triggered when people are moving around a building but not trying to exit, through the fire alarm being triggered and then to the end of the evacuation when the building is finally empty. It supports multiple floor layouts and simulates pedestrian movement down a staircase.
The model runs at about 1/30th of real-time due to constraints of the Second Life scripting environment and physics engine. The main problem being that if the pedestrian's moved any faster than they currently do the physics engine in Second Life (Havok) tends to miss collisions and so the pedestrians start walking through walls and other barriers.
Layouts:
We have provided three predefined floor layouts in the model. Each of these is described on a below along with screen shots and a movie of a model run using that layout:
It is easy to create new layouts or modify existing ones either in the predefined scripts or by just dragging walls around in Second Life.
Model Components:
Each of the parts that make up the model are shown below and are flexible enough to allow most building layouts to be re-created:
PedTrace System:
To help validate the model we linked it to a custom built web application called PedTrace running on a web server outside Second Life via HTTP messages. The web server records the position and speed of each pedestrian every second of the model. PedTrace uses this data to generate movement trace images and two graphs: a time-to-exit graph and an average walking speed graph.
PedTrace provides a webpage overview of the current model run (shown below).
Technical Details:
A PDF document containing details about how the model was implemented is available to download:
Source Code:
The Linden Scripts for this model are covered by the GNU GENERAL PUBLIC LICENSE and are available to download below.
If you prefer to get up and running more quickly we have a vending machine on nature island here that will give you a complete working copy of the model when you click on it (this is now depreciated):
Single Floor - Simple Layout
The first building layout is a 20m square room with a single exit door and no internal walls.
Below we show a movie of a model run using this layout. We also present the output from the PedTrace web application for the same model run.
Single Floor - Complicated Layout
The second building layout is the same as the first but adds internal walls and tables as obstacles for the agents.
Below we show a movie of a model run using this layout. We also present the output from the PedTrace web application for the same model run.
Two Floors
The final building layout is the same as the second but adds another floor on top and connects the two with a staircase.
Below we show a movie of a model run using this layout. We also present the output from the PedTrace web application for the same model run.
Agent and Avatar Interaction
In this final model we demonstrate how agents can be responsive to avatars. For this we use a simple building layout with two tables. As with the previous simulations, one the alarm is sounded the agents exit the room. Avoiding each other and avatars if present.
Below we show a traces of a model run using this layout with no avatars and with an avatar. We also present the output from the PedTrace web application for the same model runs.
Source Code:
The Linden Scripts for this model are covered by the GNU GENERAL PUBLIC LICENSE and are available to download below.
The Linden Scripts for this model are covered by the GNU GENERAL PUBLIC LICENSE and are available to download below:
- GNU GENERAL PUBLIC LICENSE
- Segregation Model Red Agent Script
- Segregation Model Blue Agent Script
- Segregation Model House Script
- Segregation Model Controller Script
- Segregation Model Grapher Script
- Segregation Model Line Segment Script
If you prefer to get up and running more quickly we have a vending machine on nature island here that will give you a complete working copy of the model when you click on it (this is now depreciated).
Pedestrian Evacuation Model
Introduction:
The last model we developed in Second Life was a pedestrian evacuation model. This is a much more accurate simulation of real life than the previous two models and the rules that govern the agents are a lot more complicated.
The model was designed and developed by Joel Dearden based on ideas from Andrew Crooks and Andrew Hudson-Smith.
Basic Concept Model:
We started out by building a much simpler model to investigate how pedestrian behaviour could be simulated in Second Life. The agents in this model represent people wandering around a room and this forms the idea for the initial part of the final model where pedestrians wander around a room until the fire alarm goes off.
![]() |
Wandering Agents Model |
Movie of wandering agents
Evacuation Model Detail:
The final version of the model simulates a pedestrian evacuation in response to a fire alarm, from the time before the alarm is triggered when people are moving around a building but not trying to exit, through the fire alarm being triggered and then to the end of the evacuation when the building is finally empty. It supports multiple floor layouts and simulates pedestrian movement down a staircase.
The model runs at about 1/30th of real-time due to constraints of the Second Life scripting environment and physics engine. The main problem being that if the pedestrian's moved any faster than they currently do the physics engine in Second Life (Havok) tends to miss collisions and so the pedestrians start walking through walls and other barriers.
Layouts:
We have provided three predefined floor layouts in the model. Each of these is described on a below along with screen shots and a movie of a model run using that layout:
It is easy to create new layouts or modify existing ones either in the predefined scripts or by just dragging walls around in Second Life.
Model Components:
Each of the parts that make up the model are shown below and are flexible enough to allow most building layouts to be re-created:
PedTrace System:
To help validate the model we linked it to a custom built web application called PedTrace running on a web server outside Second Life via HTTP messages. The web server records the position and speed of each pedestrian every second of the model. PedTrace uses this data to generate movement trace images and two graphs: a time-to-exit graph and an average walking speed graph.
PedTrace provides a webpage overview of the current model run (shown below).
Technical Details:
A PDF document containing details about how the model was implemented is available to download:
Source Code:
The Linden Scripts for this model are covered by the GNU GENERAL PUBLIC LICENSE and are available to download below.
- GNU GENERAL PUBLIC LICENSE
- Evacuation Model Controller Script
- Evacuation Model Builder Script
- Evacuation Model Exit Script
- Evacuation Model ExitSign Script
- Evacuation Model Floor Script
- Evacuation Model Furniture Script
- Evacuation Model Wall Script
- Evacuation Model Pedestrian Main Script
- Evacuation Model Pedestrian Wander Script
- Evacuation Model Pedestrian Demolish Listener Script
- Evacuation Model Line-Of-Sight Ray Script
- Evacuation Model Predicted Movement Volume (PMV) Script
- Evacuation Model Predicted Movement Volume (PMV) Demolish Listener Script
- Evacuation Model Staircase Predicted Movement Volume (SPMV) Script
- Evacuation Model Staircase Predicted Movement Volume (SPMV) Demolish Listener Script
- Evacuation Model Staircase Steps Script
- Evacuation Model Staircase Dummy Script
- Evacuation Model Staircase Entry Script
- Evacuation Model Staircase Start Script
- Evacuation Model Staircase End Script
- GNU GENERAL PUBLIC LICENSE
- PedTrace input.aspx
- PedTrace input.aspx.cs
- PedTrace output.aspx
- PedTrace output.aspx.cs
- PedTrace globals.cs
- PedTrace PT2DExtents.cs
- PedTrace PTFloor.cs
- PedTrace PTLineBarrier.cs
- PedTrace PTModel.cs
- PedTrace PTPedestrian.cs
- PedTrace PTPoint.cs
- PedTrace PTStaticObject.cs
- PedTrace PTTracePoint.cs
If you prefer to get up and running more quickly we have a vending machine on nature island here that will give you a complete working copy of the model when you click on it (this is now depreciated):
Single Floor - Simple Layout
The first building layout is a 20m square room with a single exit door and no internal walls.
Below we show a movie of a model run using this layout. We also present the output from the PedTrace web application for the same model run.
Simple layout movie (Agents exiting the building)
![]() |
Pedestrian paths (generated by PedTrace) |
Pedestrian paths every second of the model run (generated by PedTrace)
![]() |
Average walking speed every second (generated by PedTrace) |
![]() |
Number of pedestrian exiting every second (generated by PedTrace) |
Single Floor - Complicated Layout
The second building layout is the same as the first but adds internal walls and tables as obstacles for the agents.
Below we show a movie of a model run using this layout. We also present the output from the PedTrace web application for the same model run.
SecondLife complicated layout movie
![]() |
Pedestrian paths (generated by PedTrace) |
Pedestrian paths every second of the model run (generated by PedTrace)
![]() |
Average walking speed every second (generated by PedTrace) |
![]() |
Number of pedestrian exiting every second (generated by PedTrace) |
Two Floors
The final building layout is the same as the second but adds another floor on top and connects the two with a staircase.
![]() |
First floor of layout |
![]() |
Ground floor of layout |
Below we show a movie of a model run using this layout. We also present the output from the PedTrace web application for the same model run.
Second Life multi-floor layout movie
![]() |
Pedestrian Paths - First Floor (generated by PedTrace) |
Pedestrian paths for the first floor every second of the model run (generated by PedTrace)
![]() |
Pedestrian Paths - Ground Floor (generated by PedTrace) |
Pedestrian paths for the ground floor every second of the model run (generated by PedTrace)
![]() |
Number of pedestrian exiting every second (generated by PedTrace) |
![]() |
Average walking speed every second (generated by PedTrace) |
Agent and Avatar Interaction
In this final model we demonstrate how agents can be responsive to avatars. For this we use a simple building layout with two tables. As with the previous simulations, one the alarm is sounded the agents exit the room. Avoiding each other and avatars if present.
![]() |
Basic Room layout |
Below we show a traces of a model run using this layout with no avatars and with an avatar. We also present the output from the PedTrace web application for the same model runs.
Pedestrian Paths - With No Avatar (generated by PedTrace) |
Pedestrian paths for model with No Avatar every second of the model run (generated by PedTrace)
![]() |
Pedestrian Paths - Avatar standing to the right of the table (generated by PedTrace) |
Pedestrian Paths - Avatar standing to the right of the table every second of the model run (generated by PedTrace).
Pedestrian Paths - With no avatar every second of the model run (generated by PedTrace) and the simulation visualization of the model in SL
Pedestrian Paths - With avatar every second of the model run (generated by PedTrace) and the simulation visualization of the model in SL
![]() |
Average walking speed every second (generated by PedTrace) with no avatar |
![]() |
Average walking speed every second (generated by PedTrace) with avatar |
![]() |
Number of pedestrian exiting every second (generated by PedTrace) with no avatar |
![]() |
Number of pedestrian exiting every second (generated by PedTrace) with avatar |
Source Code:
The Linden Scripts for this model are covered by the GNU GENERAL PUBLIC LICENSE and are available to download below.
- GNU GENERAL PUBLIC LICENSE
- Evacuation Model Controller Script
- Evacuation Model Builder Script
- Evacuation Model Exit Script
- Evacuation Model ExitSign Script
- Evacuation Model Floor Script
- Evacuation Model Furniture Script
- Evacuation Model Wall Script
- Evacuation Model Pedestrian Main Script
- Evacuation Model Pedestrian Wander Script
- Evacuation Model Pedestrian Demolish Listener Script
- Evacuation Model Line-Of-Sight Ray Script
- Evacuation Model Predicted Movement Volume (PMV) Script (the only script that was changed so the agents pick up avatars as objects )
- Evacuation Model Predicted Movement Volume (PMV) Demolish Listener Script
- Evacuation Model Staircase Predicted Movement Volume (SPMV) Script
- Evacuation Model Staircase Predicted Movement Volume (SPMV) Demolish Listener Script
- Evacuation Model Staircase Steps Script
- Evacuation Model Staircase Dummy Script
- Evacuation Model Staircase Entry Script
- Evacuation Model Staircase Start Script
- Evacuation Model Staircase End Script
The Visual C# source code for the PedTrace web service has also been released under the GNU GENERAL PUBLIC LICENSE and is available to download below. You might need some knowledge of C# and ASP.NET to make this work.
- GNU GENERAL PUBLIC LICENSE
- PedTrace input.aspx
- PedTrace input.aspx.cs
- PedTrace output.aspx
- PedTrace output.aspx.cs
- PedTrace globals.cs
- PedTrace PT2DExtents.cs
- PedTrace PTFloor.cs
- PedTrace PTLineBarrier.cs
- PedTrace PTModel.cs
- PedTrace PTPedestrian.cs
- PedTrace PTPoint.cs
- PedTrace PTStaticObject.cs
- PedTrace PTTracePoint.cs
If you prefer to get up and running more quickly we have a vending machine on nature island here that will give you a complete working copy of the model when you click on it (this is now depreciated):
No comments:
Post a Comment