Burkina Faso Migration Flows
Model was written in NetLogo 6.1.1
•
Viewed 409 times
•
Downloaded 46 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Comments and Questions
Click to Run Model
extensions [ gis csv ] globals [ regions-dataset regions_ras-dataset ] breed [ region-labels region-label] breed [ migrants migrant] breed [seconds second] breed [thirds third] breed [fourths fourth] breed [fifths fifth] breed [sixths sixth] breed [sevenths seven] patches-own [ region ] migrants-own [origin destination energy ] to setup clear-all ; Note that setting the coordinate system here is optional, as ; long as all of your datasets use the same coordinate system. ; gis:load-coordinate-system (word "data/" projection ".prj") ; Load all of our datasets set regions-dataset gis:load-dataset "BFA_adm1_UTM.shp" set regions_ras-dataset gis:load-dataset "BFA_adm1_UTM_ascii.asc" ; Set the world envelope to the union of all of our dataset's envelopes gis:set-world-envelope (gis:envelope-of regions-dataset) set-default-shape migrants "people" display-regions display-raster-in-patches ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;; CREATES MIGRANTS ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; create-turtles 1 ;;Boucle de Mouhoun [ set xcor -41 set ycor 5 ;; These breeds of turtles, seconds, thirds etc, are used as set color red ] ;; heading anchors that are invisible (same color as pcolor), ;;but allow other turtle to face them and go towards that region xycor create-seconds 1 [ set xcor -60 set ycor -41 ;;Second 14, Cascades set color 15 ] create-thirds 1 ;; Third 15, EST [set xcor 46 set ycor 0 set color grey ] create-fourths 1 [set xcor 9 set ycor -16 ;; Fourth 16, Center Sud set color grey] create-fifths 1 [set xcor -66 set ycor -31 ;;Fifth 17, N Cascades set color grey] create-sixths 1 [set xcor 17 set ycor 41 ;; Sixth 18, Sahel set color 45] create-sevenths 1 [set xcor -57 set ycor -18 ;Seventh 19 set color 17] ask n-of 200 patches [ ifelse (region = 10) ; Nord [sprout-migrants 20] [ifelse (region = 1) ; Boucle du Mouhoun [sprout-migrants 20] [ifelse (region = 2) ; Cascades [sprout-migrants 20] [ifelse (region = 3) ; Centre [sprout-migrants 20] [ifelse (region = 4) ; Centre-Est [sprout-migrants 20] [ifelse (region = 5) ; Centre-Nord [sprout-migrants 20] [ifelse (region = 6) ; Centre-Ouest [sprout-migrants 20] [ifelse (region = 7) ; Centre-Sud [sprout-migrants 20] [ifelse (region = 8) ; Est [sprout-migrants 20] [ifelse (region = 9) ; Hauts-Bassins [sprout-migrants 20] [ifelse (region = 11); Plateau Central [sprout-migrants 20] [ifelse (region = 12) ; Sahel [sprout-migrants 20] [ifelse (region = 13) ; Sud-Ouest [sprout-migrants 20] [sprout-migrants 0] ]]]]]]]]]]]]] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;; COLORS MIGRANTS ;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ask migrants [ ifelse (region = 1) ; Boucle du Mohoun [ set color 16 set energy 20] [ ifelse (region = 2) ; Cascades [set color 15 set energy 20] [ifelse (region = 3) ; Centre [set color 16.5 set energy 10] [ifelse (region = 4) ; Centre-Est [set color 36 set energy 20] [ifelse (region = 5) ; Centre-Nord [set color 97 set energy 10] [ifelse (region = 6) ; Centre-Ouest [set color sky set energy 15] [ifelse (region = 7) ; Centre-Sud [set color 27 set energy 20] [ifelse (region = 8) ; Est [set color 47 set energy 20] [ifelse (region = 9) ; Hauts-Bassins [set color 17 set energy 100] [ifelse (region = 10) ; Nord [set color blue set energy 40] [ifelse (region = 11) ; Plateau Central [set color 37 set energy 20] [ifelse (region = 12) ; Sahel [set color yellow set energy 160] [ifelse (region = 13) ; Sud-Ouest [set color 38 set energy 20] [ set color gray ] ] ] ] ] ] ] ] ] ] ] ] ] ] reset-ticks end ; Drawing polygon data from a shapefile, and optionally loading some ; of the data into turtles, if label-countries is true to display-regions ask region-labels [ die ] gis:set-drawing-color white gis:draw regions-dataset 1 if label-regions [ foreach gis:feature-list-of regions-dataset [ vector-feature -> let centroid gis:location-of gis:centroid-of vector-feature ; centroid will be an empty list if it lies outside the bounds ; of the current NetLogo world, as defined by our current GIS ; coordinate transformation if not empty? centroid [ create-region-labels 1 [ set xcor item 0 centroid set ycor item 1 centroid set size 0 set label gis:property-value vector-feature "ADM1" ] ] ] ] end to display-raster-in-patches ; This is the preferred way of copying values from a raster dataset ; into a patch variable: in one step, using gis:apply-raster. gis:apply-raster regions_ras-dataset region ; Hopefully, this will color the patches accordingly ask patches [ ifelse (region = 1) ; Boucle du Mohoun [ set pcolor 16] [ ifelse (region = 2) ; Cascades [set pcolor 15] [ifelse (region = 3) ; Centre [set pcolor 16.5] [ifelse (region = 4) ; Centre-Est [set pcolor 36] [ifelse (region = 5) ; Centre-Nord [set pcolor 97] [ifelse (region = 6) ; Centre-Ouest [set pcolor sky] [ifelse (region = 7) ; Centre-Sud [set pcolor 27] [ifelse (region = 8) ; Est [set pcolor 47] [ifelse (region = 9) ; Hauts-Bassins [set pcolor 17] [ifelse (region = 10) ; Nord [set pcolor blue] [ifelse (region = 11) ; Plateau Central [set pcolor 37] [ifelse (region = 12) ; Sahel [set pcolor yellow] [ifelse (region = 13) ; Sud-Ouest [set pcolor 29] [ set pcolor gray ] ] ] ] ] ] ] ] ] ] ] ] ] ] ;give-energy end ;to assign-origin ; Hopefully, this assigns an origin and MAYBE destination to migrants along ; with energy ; ask migrants [ ; ifelse (region = 10) ;[ set origin 10 ; set energy 100 ; set destination ;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;; 1975 ;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;; to year-1975 ask migrants with [color = blue][ face turtle 13 ] check-arrival move-1975 out-flow-1 ; Nord towards Boucle de Mouhoun ask migrants with [color = 95] [face turtle 13] ; Centre Ouest to B de M check-arrival move-1975 out-flow-1 ; check-settled ask migrants with [color = 27] [face third 15] check-arrival move-1975 out-flow-1 ask migrants with [color = 97] [face sixth 18] check-arrival move-1975 out-flow-1 tick if ticks = 150 [ stop ] ;;specify when to stop model after migration occurs! end ;to check-settled ;force turtles to stay in place ; end to check-arrival ;changes the path color of the region to a mixed color ask patches with [ pcolor = 16 ] [if any? migrants-here with [color = blue] [set pcolor 113] ] ask patches with [pcolor = 17] [if any? migrants-here with [color = blue] [set pcolor 117 ] ] ask patches with [pcolor = yellow] [if any? migrants-here with [color = blue] [set pcolor 57] ] ask patches with [pcolor = 16] [if any? migrants-here with [color = 95] [set pcolor 113]] ask patches with [pcolor = 47] [if any? migrants-here with [color = 27] [set pcolor 16] ] ask patches with [pcolor = 45] [if any? migrants-here with [color = 97 ] [set pcolor 66 ] ] ;supposed to change patches nearby to new color as well similar to diffuse color ;set pcolor violet] end to move-1975 ask migrants with [color = blue] [rt random 90 lt random 80 fd 1 if any? turtles-here [rt 180] ];;makes the turtles say relatively within the coutry by making them turn ask migrants with [color = 95] [ rt random 90 lt random 80 fd 1 if any? turtles-here [rt 180] ] ask migrants with [color = 27] [ rt random 90 lt random 80 fd 1 if any? turtles-here [rt 180] ] ask migrants with [color = 97] [rt random 90 lt random 80 fd .5 if any? turtles-here [rt 180] ] end to out-flow-1 ;;OUT MIGRATION ask patches with [pcolor = 95] [ if any? migrants-here with [color = 95] [set pcolor 96] ] ;changes centre ouest lighter ask patches with [pcolor = blue] [ if any? migrants-here with [color = blue] [set pcolor 106] ] ;changes Nord lighter ask patches with [pcolor = 97] [ if any? migrants-here with [color = 97] [set pcolor 98] ] ;changes centre nord lighter from out migration ask patches with [pcolor = 27] [ if any? migrants-here with [color = 27] [set pcolor 28] ] ; lighter centre sud end ;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;; 1985 ;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;; to year-1985 ask migrants with [color = blue] ; Nord to Cascades/ HB region [face fifth 17] check-arrival-1 move-1985 out-flow-2 ask migrants with [color = 97] ; Centre Nord to Boucle de Mouhoun [face turtle 13] check-arrival-1 move-1985 out-flow-2 ask migrants with [color = 95] ;; [face fifth 17] check-arrival-1 move-1985 out-flow-2 ask migrants with [color = 27] [face third 15] check-arrival-1 move-1985 out-flow-2 tick if ticks = 200 [stop] end to check-arrival-1 ask patches with [ pcolor = 16 ] [if any? migrants-here with [color = blue] [set pcolor violet] ] ;Nord to Boucle de Mouhoun ask patches with [pcolor = 17] [if any? migrants-here with [color = blue] [set pcolor 113 ] ] ;Nord to Hauts Bassins ask patches with [pcolor = 16.5] [if any? migrants-here with [color = blue] [set pcolor 113] ] ;Nord to Centre ask patches with [pcolor = 16.5] [if any? migrants-here with [color = 97] [set pcolor 115] ] ask patches with [pcolor = 15] [if any? migrants-here with [color = blue] [set pcolor 113] ] ;Nord to Cascades ask patches with [pcolor = 47] [if any? migrants-here with [color = blue] [set pcolor 57] ] ;Nord to Est ask patches with [pcolor = 17] [if any? migrants-here with [color = 97] [set pcolor 113]] ask patches with [pcolor = 95] [if any? migrants-here with [color = 97] [set pcolor 94]] ask patches with [pcolor = 15] [ if any? migrants-here with [color = 95] [set pcolor 113]] ;centre nord to N. Cascades ask patches with [pcolor = 16.5] [if any? migrants-here with [color = 95] [set pcolor 115] ] ;centre nord to HB ask patches with [pcolor = 47] [if any? migrants-here with [color = 97] [set pcolor 57] ];Centre Nord to Est ask patches with [pcolor = 17] [if any? migrants-here with [color = 95] [set pcolor 113]] ask patches with [pcolor = 16] [ if any? migrants-here with [color = 95] [set pcolor 115]] ask patches with [pcolor = 47] [ if any? migrants-here with [color = 27][ set pcolor 16]] ;supposed to change patches nearby to new color as well similar to diffuse color ;set pcolor violet] end to move-1985 ask migrants with [color = blue] [ rt random 90 lt random 80 fd 1.2 if any? turtles-here [rt 180] ] ask migrants with [color = 95] [ rt random 50 lt random 100 fd .5 if any? turtles-here [rt 180] ] ask migrants with [color = 97] [ rt random 80 lt random 70 fd 1 if any? turtles-here [rt 180] ] ask migrants with [color = 27] [ rt random 70 lt random 80 fd 1 if any? turtles-here [rt 180] ] ask migrants with [color = 36] [ rt random 70 lt random 80 fd 1 if any? turtles-here [rt 180] ] end to out-flow-2 ;ask patches with [pcolor = 95] [ ; if any? migrants-here with [color = 95] [set pcolor 96] ] ;changes centre ouest lighter ask patches with [pcolor = blue] [ if any? migrants-here with [color = blue] [set pcolor 106] ] ;changes Nord lighter ask patches with [pcolor = 97] [ if any? migrants-here with [color = 97] [set pcolor 98] ] ;changes centre nord lighter from out migration ask patches with [pcolor = 27] [ if any? migrants-here with [color = 27] [set pcolor 28] ] ; lighter centre sud end ;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;; 1996 ;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;; to year-1996 ask migrants with [color = blue] [face second 14] ;N Towards Cascades and Hauts Bassins Centre Sud check-arrival-2 move-1996 out-flow-3 ; check-settled ] ask migrants with [color = 97] [ face third 15] check-arrival-2 move-1996 out-flow-3 ask migrants with [color = 38] [face fourth 16] ;; to centre sud check-arrival-2 move-1996 out-flow-3 ask migrants with [color = 45] [face fifth 17 ] check-arrival-2 move-1996 out-flow-3 ask migrants with [color = 36] [face fourth 16 ] check-arrival-2 move-1996 out-flow-3 tick if ticks = 160 [stop] end to check-arrival-2 ask patches with [pcolor = 15] [if any? migrants-here with [color = blue] [set pcolor 113]] ask patches with [pcolor = 15] [if any? migrants-here with [color = 97] [set pcolor 113]] ; CASCADES color change influx ask patches with [pcolor = 15] [ if any? migrants-here with [color = 45][set pcolor 113]] ask patches with [pcolor = 16] [ if any? migrants-here with [pcolor = blue][set pcolor 115]] ; BDM color change influx ask patches with [pcolor = 16] [ if any? migrants-here with [pcolor = 97][set pcolor 115]] ask patches with [ pcolor = 16 ] [if any? migrants-here with [color = blue] [set pcolor 117]] ask patches with [pcolor = 16] [if any? migrants-here with [color = blue] [set pcolor 117] ] ask patches with [pcolor = 16] [if any? migrants-here with [color = 45] [set pcolor 117] ] ask patches with [pcolor = 16.5] [if any? migrants-here with [color = blue] [set pcolor 113]] ;Centre change ask patches with [pcolor = 16.5] [ if any? migrants-here with [color = 38] [set pcolor 113]] ask patches with [pcolor = 16.5] [if any? migrants-here with [color = 45] [set pcolor 113] ] ask patches with [pcolor = 17] [if any? migrants-here with [color = blue] [set pcolor 113 ] ] ask patches with [pcolor = 17] ;HB color change [if any? migrants-here with [color = 97] [set pcolor 113]] ask patches with [pcolor = 17] [if any? migrants-here with [color = 95] [set pcolor 113]] ask patches with [pcolor = 17] [if any? migrants-here with [color = 45] [set pcolor 113] ] ask patches with [pcolor = 27] [ if any? migrants-here with [color = 38][set pcolor 113]] ask patches with [pcolor = 47] [if any? migrants-here with [color = blue] [set pcolor lime]] ask patches with [pcolor = 47] [if any? migrants-here with [color = 95] [set pcolor lime]] ask patches with [pcolor = 47] [if any? migrants-here with [color = 97] [set pcolor lime]] ask patches with [pcolor = 95] [if any? migrants-here with [color = 97] [set pcolor 94]] ask patches with [pcolor = 95] [if any? migrants-here with [color = blue] [set pcolor 94] ] ask patches with [pcolor = 37][ if any? migrants-here with [color = 38][set pcolor 113]] ask patches with [pcolor = 37] [if any? migrants-here with [color = 45] [set pcolor 113] ] ask patches with [pcolor = 27][ if any? migrants-here with [color = 36][set pcolor 113]] end to move-1996 ask migrants with [color = blue] ;N to HB and Cascades highest influx [ rt random 90 lt random 60 fd 1.1 if any? turtles-here [rt 180] ] ask migrants with [color = 97] [ rt random 90 lt random 80 fd .4 if any? turtles-here [rt 180] ] ask migrants with [color = 45] [ lt random 20 rt random 35 fd .2] ask migrants with [color = 38] [ lt random 80 rt random 30 fd .2 ] ask migrants with [color = 36] ;S [ lt random 60 rt random 80 fd .1 ] end to out-flow-3 ask patches with [pcolor = blue] [ ;;Out flux from north if any? migrants-here with [color = blue] [set pcolor 106]] ask patches with [pcolor = 45] [ ;;Out flux from sahel if any? migrants-here with [color = 45] [set pcolor 46]] ask patches with [pcolor = 36] [ if any? migrants-here with [color = 36][set pcolor 38]] end ;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;; 2006 ;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;; to year-2006 ask migrants with [color = blue] ; Nord to Cascades/ HB region [face fourth 16] check-arrival-3 move-1985 out-flow-4 ask migrants with [color = 97] ; [face second 14] check-arrival-3 move-2006 out-flow-4 ask migrants with [color = 95] [face third 15] check-arrival-3 move-2006 out-flow-4 ask migrants with [color = 38] [face fifth 17] check-arrival-3 move-2006 out-flow-4 ask migrants with [color = 36] [face fifth 17] check-arrival-3 move-2006 out-flow-4 ask migrants with [color = 16] [face fifth 17] check-arrival-3 move-2006 out-flow-4 ask migrants with [color = 45] [face fifth 17] check-arrival-3 move-2006 out-flow-4 tick if ticks = 150 [stop] end to check-arrival-3 ; ask patches with [ pcolor = 16 ] ;[if any? migrants-here with [color = blue] [set pcolor violet] ] ;Nord to Boucle de Mouhoun ask patches with [pcolor = 15] [if any? migrants-here with [color = 95] [set pcolor 113]] ask patches with [pcolor = 15] [if any? migrants-here with [color = 97] [set pcolor 113]] ask patches with [pcolor = 15] [if any? migrants-here with [color = blue] [set pcolor 113]] ask patches with [pcolor = 15] [if any? migrants-here with [color = 38] [set pcolor 113]] ask patches with [pcolor = 16.5] [if any? migrants-here with [color = blue] [set pcolor 113] ] ;Nord to Centre ask patches with [pcolor = 17] [if any? migrants-here with [color = blue] [set pcolor 113 ] ] ;Nord to Hauts Bassins ask patches with [pcolor = 17] [if any? migrants-here with [color = 97] [set pcolor 113]] ask patches with [pcolor = 17] [if any? migrants-here with [color = 36 ] [set pcolor 113]] ask patches with [pcolor = 47] [if any? migrants-here with [color = blue] [set pcolor lime] ] ;Nord to Est ask patches with [pcolor = 47] [if any? migrants-here with [color = 97] [set pcolor lime]] ask patches with [pcolor = 47] [if any? migrants-here with [color = 95] [set pcolor lime]] ask patches with [pcolor = 27] [if any? migrants-here with [color = blue] [ set pcolor 132]] end to move-2006 ask migrants with [color = blue] [ rt random 40 lt random 100 fd .1 if any? turtles-here [rt 180] ] ask migrants with [color = 97] [ rt random 90 lt random 60 fd 1 if any? turtles-here [rt 180] ] ask migrants with [color = 95] [ rt random 90 lt random 60 fd .1 if any? turtles-here [rt 180] ] ask migrants with [color = 38] [ rt random 90 lt random 60 fd 1 if any? turtles-here [rt 180] ] ask migrants with [color = 36] ; to N cascades [ rt random 70 lt random 60 fd 1 if any? turtles-here [rt 180] ] ask migrants with [color = 45] [ rt random 50 lt random 30 fd 1 if any? turtles-here [rt 180] ] end to out-flow-4 ask patches with [pcolor = 37] [if any? migrants-here with [color = 37] [set pcolor 38]] ask patches with [pcolor = 16] [if any? migrants-here with [color = 16][set pcolor 17]] ask patches with [pcolor = 45] [if any? migrants-here with [color = 45][set pcolor 46]] ask patches with [pcolor = 29] [if any? migrants-here with [color = 38][set pcolor 9]] end ; Public Domain: Creation by C.T. West & J.L. Deview of the University of North Carolina at Chapel Hill ; Information from C. T. West's research in Burkina Faso and census data.
There are 4 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
BFA_adm1_UTM.cpg | data | Burkina Faso Regions Vector cpg file | over 3 years ago, by Jenny Deview | Download |
BFA_adm1_UTM.dbf | data | Burkina Faso dbf file | over 3 years ago, by Jenny Deview | Download |
BFA_adm1_UTM.prj | data | Burkina Faso Regions prj file | over 3 years ago, by Jenny Deview | Download |
BFA_adm1_UTM.sbn | data | Burkina Faso sbn file | over 3 years ago, by Jenny Deview | Download |
BFA_adm1_UTM.sbx | data | Burkina Faso sbx file | over 3 years ago, by Jenny Deview | Download |
BFA_adm1_UTM.shp | data | Burkina Faso regions shapefile | over 3 years ago, by Jenny Deview | Download |
BFA_adm1_UTM.shx | data | Burkina Faso regions shx file | over 3 years ago, by Jenny Deview | Download |
bfa_adm1_utm_ascii.asc | data | Burkina Faso Raster ascii file | over 3 years ago, by Jenny Deview | Download |
BFA_adm1_UTM_ascii.prj | data | Burkina Faso Raster projection file | over 3 years ago, by Jenny Deview | Download |
Burkina Faso Migration Flows.png | preview | Preview for 'Burkina Faso Migration Flows' | over 3 years ago, by Jenny Deview | Download |
This model does not have any ancestors.
This model does not have any descendants.
Jenny Deview
Corruption in Data File Issues
When unzipping this model and its associated files some may become corrupted. In file explorer, edit the name of corrupted files to remove the word "CORRUPT." in the prefix and the model should work.
Posted over 3 years ago
Didier Ruedin
Getting this model to run on NetLogo 6.3
(1) I had to manually re-download the "BFA_adm1_UTM.shp" file from the "Files" tab on this page (the file in the zipped document gave me an error in NetLogo: "Points of LinearRing do not form a closed linestring"). (2) The capitalization for the ASCII file in the code did not match the file, changing it to set regions_ras-dataset gis:load-dataset "bfa_adm1_utm_ascii.asc" helped (this may not be an issue for Windows, but my GNU/Linux machine cares about cases).
Posted almost 2 years ago