CoolWorld

This applet requires Java 1.4.1 or higher. You may obtain the latest Java plugin from Sun's Java site.


created with NetLogo
view/download model file: CoolWorld.nlogo

QUICK GUIDE

clear This button resets the model, and generates a random seed from the current time.
change-random-seed This button enables the user to select a random seed.
create-hot-spot Press this button and then click on a patch in the display area to set the selected patch's temperature to 100. When finished, click on the button again.
special-conditions This button sets some particular initial conditions for the model.
diffuse-heat Press this button to diffuse the heat from patches to their surrounding patches.
pause-at-time-step The model will halt at the end of this time-step. To resume, you can press the button go again.
create-house Press this button and then click on a patch in the display area to place a house on the selected patch. When finished, click on the button again.
go Pressing this button will run the model until this same button is pressed again (or until time-step pause-at-time-step, if not reached yet).
create-walker Press this button and then click on a patch in the display area to place a walker on the selected patch. When finished, click on the button again.
go-once Pressing this button will run the model one time-step only; i.e. every walker is given only one opportunity to move.
prob-random-move In every time-step, this is the probability that a walker moves randomly to one of her neighbouring patches, instead of moving to one of her hottest neighbouring patches.
display-mode Patches are coloured according to their temperature value (if display-mode is Temperature) or according to the number of visits they have received (if display-mode is Visits).
prob-leaving-home In every time-step, this is the probability that a walker who is in a house abandons it.
view-hide These buttons show or hide patches' temperature rounded to the nearest integer.

DESCRIPTION OF THE MODEL

CoolWorld is an agent-based model designed to illustrate the usefulness of the theory of Markov chains to analyse computer models. This section explains the formal model that CoolWorld implements. The information provided here should suffice to re-implement the same formal model in any sophisticated enough modelling platform. We use bold red italicised arial font to denote parameters (i.e. variables that can be set by the user). For the sake of clarity in the explanation, we distinguish two components in CoolWorld: the agents and the environment. The agents in CoolWorld wander around the (cold) environment, showing a preference for warm places and houses.

The environment

The environment in CoolWorld is a 2-dimensional grid divided into square patches. The size and topology (toroidal, cylindrical, or fully bounded) of the environment can be set by the user. The environment has a certain temperature profile and a distribution of houses. More precisely:

Unless the user interacts with the model at run-time, neither the temperature profile nor the distribution of houses changes during the course of a simulation run. Finally, a patch’s neighbourhood is defined as the set of (up to 8) other patches with which the patch shares an edge or a corner.

The agents

Agents in CoolWorld are called walkers, as walking on the environment is pretty much all they do. The user can choose the number of walkers and their initial location (i.e. a certain patch). When a walker is given the opportunity to move, her behaviour is determined by the following algorithm:

The value of prob-leaving-home and prob-random-move is shared by every walker in the model. There is no restriction about the number of walkers that can stay on the same patch at any time.

Scheduling of events

Events in CoolWorld take place in discrete time-steps. In every time-step each individual walker is given the opportunity to move once.

HOW TO USE IT

We use bold blue arial font to denote button names. The button Clear resets the model, and generates a random seed from the current time.

Setting up the environment

The environment in the applet above is made up of 33 patches x 33 patches and does not wrap around. The size and topology of the environment can be changed by the user if the model is downloaded and used within NetLogo.

Setting up walkers

The user can choose the number of walkers and their initial position by clicking on Create walker. When this button is clicked on, a walker is created on the selected patch, unless there is already a walker on that same patch. The values of prob-leaving-home and prob-random-move can be set using the corresponding sliders.

Other settings


Random seed
The user can also change the value of the random seed used to generate pseudorandom numbers by clicking on Change random seed. This functionality provides the opportunity to conduct exact replications of individual simulation runs.
Predefined initial conditions
If the button Special Conditions is pressed, the model is parameterised as follows:
  • Environment: The temperature profile is concentrical, i.e. a patch’s temperature is inversely proportional to its distance to the central patch. A house is created in every patch whose distance to the centre of the environment is greater or equal to 5 units and less than 6 units (distances between patches are measured from their centres).
  • Walkers: There are 100 walkers and they all start at a random initial location. The value of prob-leaving-home is 0.01 and the value of prob-random-move is 0.5.

Halting the model at a certain time-step
The user can pause the model at any time-step by setting the slider pause-at-time-step.
special conditions

Running the model

When the button go once is pressed, every walker is given one opportunity to move. Pressing the button go runs the model indefinitely (or until time-step pause-at-time-step, if not reached yet). The user can modify the value of any parameter at run-time. In particular, new hot spots and walkers can be created while the model runs.

Displays

The large square roughly in the middle of the applet is the representation of the 2D environment and the walkers. Houses house are coloured in orange. Walkers are coloured in green, and represented as a person person if standing on a patch without a house, and as a smiling face smiling face if standing on a patch with a house. In the latter case, the white label indicates the number of walkers in the same house.

Patches are coloured according to their temperature value (if display-mode is Temperature) or according to the number of visits they have received (if display-mode is Visits).

LICENCE

CoolWorld is an agent-based model designed to illustrate the usefulness of the theory of Markov chains to analyse computer models.
Copyright (C) 2008 Luis R. Izquierdo, Segismundo S. Izquierdo, José M. Galán & José I. Santos

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You can download a copy of the GNU General Public License by clicking here; you can also get a printed copy writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Contact information:
Luis R. Izquierdo
University of Burgos, Spain.
e-mail: luis@izquierdo.name

MODELLERS

This program has been designed and implemented by Luis R. Izquierdo, Segismundo S. Izquierdo, José M. Galán & José I. Santos


Final notes: Precise workings of Diffuse heat.
When the button Diffuse heat is pressed, the following algorithm is executed sequentially 10 times: “Each patch shares 50 percent of its temperature with its eight neighbouring patches. If a patch has fewer than eight neighbours the remainder stays on the patch whose temperature is being shared. Temperature updating occurs synchronously, i.e. all patches calculate at the same time how much temperature to give to each of their neighbours considering their individual temperature at time t; once every patch has calculated how much to share with each of its neighbours, all patches’ new temperature values at time t + 1 are updated at the same time.”