A simple Levins type model
Note that the applet version does not seem to work with GIS data. The model files can be obtained from here.
WHAT IS IT?
This is a very simple implementation of a Levins type metapopulation.
All patches are assumed to be homogeneous with respect to extinction risk when occupied (ext_prob expressed as % in the interface)
If an unoccupied patch has any linked patch which is occupied it can be recolonised with a certain probability (col_prob expressed as % in the interface)
HOW IT WORKS
Centroids are loaded using the GIS extension. The distances between them are used to set up the links.
HOW TO USE IT
As the model stands it is only useful for teaching the concept.
Sensitivity could be analysed using the behaviour space tool. While the model is too simplistic to represent any real situation it is paramaterised using real GIS data and therefore can be related to a known landscape. In this case, the New Forest, but other vector layers can easily be used.
THINGS TO NOTICE
The model does not take into account the area of the habitat when evaluating extinction risk nor the absolute distance between patches when evaluating colonisation.
THINGS TO TRY
Change any of the parameters.
Watch the ouptut in order to see on which parts of the network the populations persist.
EXTENDING THE MODEL
Many more realistic elements could be built from here. The patches should know their area and the true distance to neighbours. Habitat quality could also be included.
Note the simplicity of the code for actually making the model run.
This is a very similar little model in R.
CREDITS AND REFERENCES
extensions [ gis ];;This makes the gis extension available.
;; It is provided by default in netlogo 5
;;The netlogo lists into which the gis layers are loaded have to be defined as
;; globals. So we have “wood” for the polygons and centroids
;; There is also a global scale factor that is used to translate meters into
;; Netlogo units. It took me a while to see why this was necessary, as I assumed
;; it was all taken care of in the “setup-gis-world” function
;;In fact it is very important to get this right when loading rasters and setting patch variables from them.
globals [path wood centroids scale_factor]
;; The global variables include the names that the GIS layers will have when imported
;; The scale_factor is the ratio between the width of a netlogo patch and the unit of
;; measurement (m) in the GIS layer.
breed [habitats habitat]
;; The nodes are habitats. They are given a breed name
habitats-own [gid area perimeter occupied?]
;;The properties of the habitats could be estended in a more detailed model
;; Links may own the property of distance, if measured. In a model with edge-edge distance this
;; will become very important.
set scale_factor 100
;; Do not forget the scale fator! 1 km will be 10 units in the model.
set wood gis:load-dataset “NFAnWood.shp”
;; Import the polygons
set centroids gis:load-dataset “NFAnWood_Centroids.shp”
;;Import the centroids
setup-gis-world gis:envelope-of wood 2
;; The line above is vital. Check the setup-world-function below for more details.
gis:draw centroids 2
;; This does what it says. The centroids are now drawn on the interface. But they may be
;; overwritten once they have been converted into “turtles” of the habitat breed using the
;; code below.
;; Notice that we need to cycle through the feature list. Each member of this list
;; coincides with a row in the vector layer attributes table.
foreach gis:feature-list-of centroids [
;; In this case there should only be one vertex, but use the code in the conventional
;; Gis extension example for safety.
let location gis:location-of (first (first (gis:vertex-lists-of ?)))
;; Now simply place a habitat turtle at each position and set all its attributes-
;; Some of these are read from the vector layer.
create-habitats 1 [
set shape “circle”
set color green
set xcor item 0 location
set ycor item 1 location
set gid gis:property-value ? “gid”
set area gis:property-value ? “area”
set size 3
set occupied? FALSE
set perimeter gis:property-value ? “perimeter”
if count habitats with [occupied? = TRUE] = 0 [stop]
ask habitats [create-links-with other habitats in-radius (sep_dist / scale_factor) ]
to setup-gis-world [bbox patchsize]
;; The bounding box is read from the gis layer that is passed to this function. See the call in “setup”.
let gis-width item 1 bbox – item 0 bbox
;; Find the width of the box in GIS units (probably meters)
let gis-height item 3 bbox – item 2 bbox
;; Find the height in GIS units.
resize-world 0 gis-width / scale_factor 0 gis-height / scale_factor
;; This is VITAL: The underlying coordinate system is resized. This is not explicit in the examples provided.
;; It is necessary to ensure that when a call is made to a function such as “in-radius” there is a clear
;; reltionship between the units used by netlogo and the GIS units. In this case the scale factor of 100 results in
;; a corrspondence of 1 unit in netlogo space to 100 m in gis space. This is not obvious in examples
;; which do not mix the two. It is particularly important when rasters are imported, as this is all related to resolution
;; and grain size.
;; The patch size could be derived automatically, but here it is set in the function call.
;; Again be careful here. This controls the grain size of the diplay.
ask patches [set pcolor white]
gis:draw wood 2
ask n-of 50 habitats
[set color red
set occupied? TRUE