forked from skfagyemang/TI-City-Model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TI-City_prediction2030.nlogo
1668 lines (1425 loc) · 43 KB
/
TI-City_prediction2030.nlogo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
extensions [GIS]
globals [road-dataset
road-presence-dataset
healthfacility-dataset
suburban-dataset
shoppingmall-dataset
market-dataset
airport-dataset
cbd-dataset
urban-dataset
urban2000-dataset
bu2000-prox-dataset
prox-bu2010-dataset
district-dataset
density-dataset
airport-vector
structureplan-dataset
school-dataset
landvalues-dataset
slope-dataset
slope_max
develop_prob
exclusion-dataset
title-dataset
attractive2000-dataset
attractive2015-dataset
;;the-row
rows
]
;;.....................................................................
;;.....................................................................
;; DEFINE PARCEL ATTRIBUTES
patches-own [
road ;;proximity to road
road-presence ;; whether or not there is road
healthfacility
suburb
suburb-area ;; to define patches within a specified radius of suburbs
shoppingmall
market
airport
;;bu2000-prox ;; proximity to 2000 built-up
bu2010 ;; proximity to 2010 built-up
cbd
urban
;;urban2000
neighbourhood
;;neighbourhood2000
nom-neighbourhood
airport-dist
nom-airport-dist
district
density
density-flip
landvalue
splan
school
;;attractive2000
attractive2015
;;attract2000-area
attract2015-area
title-reg
slope
nom-slope
exclusion
suitability
informality
informal_avail ;; informal lands that are available for development
LI-movement ;; whether or not low income household has moved to a parcel
HI-movement ;; whether or not high income household has moveed to a parcel
MI-movement ;; whether or not mid income household has moved to a parcel
new-urban ;; all new developments
ULI ;; utility for low income households
UHI ;; utility for high income households
UMI ;; Utility for mid income households
UHED ;; Utility for High end estate developers
UMED ;; Utility for mid end estate developers
pHED-movement ;; whether or not high end estate developer has moved to a parcel
pMED-movement ;; whether or not mid end estate developer has moved to a parcel
first-n-ULI ;; whether the patch has one of the highest low income utility
first-n-UHI ;; whether the patch has one of the highest high income utility
first-n-UMI ;; whether the patch has one of the highest middle income utility
first-n-UHED ;; whether the patch has one of the highest utilities for high end estate developers
first-n-UMED ;; whether the patch has one of the highest utilities for mid end estate developers
]
;;................................................................................................
;;................................................................................................
;; CREATE HOUSEHOLDS AND DEVELOPERS
breed [ households household ]
households-own [
income-status
income
LIH-movement
HIH-movement
MIH-movement
]
;;.................................................
breed [ developers developer ]
developers-own [
class
HED-movement
MED-movement]
;;.................................................
to make-households
;;.. creation of households
let i household-number
create-households i [
;;..specification of representation shape
set shape "person"
set color white
set size 1
]
ask turtles [setxy 70 387] ;
;;.. create socio-economic characteristics of households
;;.. create households with low income-status
let j percent-low-income-households
let x (j / 100) * i
ask n-of x households [
set income-status 1]
;;.. create middle-income households
let a percent-mid-income-households
let b (a / 100) * i
ask n-of b households with [income-status != 1]
[set income-status 2]
;;.. create high-income households
let h percent-high-income-households
let c (h / 100) * i
ask n-of c households with [income-status = 0]
[set income-status 3]
end
;;.......................................................................
to make-developers
let i estate-developer-number
create-developers i [
set shape "person"
setxy 76 391
set color blue
set size 1]
;; create mid-end-developers
let j percent-mid-end-developers
let w (j / 100) * i
ask n-of w developers [
set class 2]
;;.. create high-end-developers
let a percent-high-end-developers
let b (a / 100) * i
ask n-of b developers with [class = 0]
[set class 3]
end
;;..........................................................
;;..........................................................
;; INITIALIZE THE MODEL
to set-up
ca
make-households
make-developers
;;load-urban2000
load-urban
;ask patches [ifelse urban = 1 [ set pcolor brown ] [set pcolor green]]
load-roads
load-healthfacilities
load-suburbs
load-shoppingmalls
load-market
load-airport
load-cbd
load-district
load-density
load-prox-bu2010
;;load-bu2000
load-neighbourhood
;;load-neighbourhood2000
load-landvalues
load-splan
;;load-income
load-school
load-title-reg
;;load-attractive2000
load-attractive2015
load-exclusion
load-slope
load-suitability
load-informality
load-informal-avail
activate-development-control
load-nom-neighbourhood
load-ULI
load-UHI
load-UMI
load-UMED
load-UHED
;;load-developers-utility
;;load-income
;;load-suburb-area
reset-ticks
end
;;...................................................
;;...................................................
;; RUN THE MODEL
to go
ifelse ticks = simulation-period
[stop]
[
make-high-income-household-development
make-mid-income-household-development
make-low-income-household-development
make-high-end-RED
make-mid-end-RED
update-neighbourhood
]
tick
end
;;.................................................................................
;;.................................................................................
;; LOAD DATASETS
;; load land values
to load-landvalues
;;set landvalues-dataset gis:load-dataset "data/landvalue_idw_accra.asc"
set landvalues-dataset gis:load-dataset "data/landvalue_categorical_accra.asc"
gis:apply-raster landvalues-dataset landvalue
;;gis:paint landvalues-dataset 0
end
;;load local plan
to load-splan
set structureplan-dataset gis:load-dataset "data/structureplan.accra.asc"
gis:apply-raster structureplan-dataset splan
;;gis:paint structureplan-dataset 0
end
;;load exclusion layer
to load-exclusion
set exclusion-dataset gis:load-dataset "data/exclusion_accra_new.asc"
gis:apply-raster exclusion-dataset exclusion
;;gis:paint exclusion-dataset 0
end
;;load slope
to load-slope
set slope-dataset gis:load-dataset "data/slope_accra.asc"
gis:apply-raster slope-dataset slope
;;gis:paint slope-dataset 0
end
;; land title registration status
to load-title-reg
set title-dataset gis:load-dataset "data/title_accra.asc"
gis:apply-raster title-dataset title-reg
;;gis:paint title-dataset 0
end
;;load distance to raods
to load-roads
set road-dataset gis:load-dataset "data/prox_trunkroads.asc"
gis:apply-raster road-dataset road
;;gis:paint road-dataset 0
set road-presence-dataset gis:load-dataset "data/road-presence.accra.asc"
gis:apply-raster road-presence-dataset road-presence
end
;;load distance to health facilities
to load-healthfacilities
set healthfacility-dataset gis:load-dataset "data/prox_healthfacilities.asc"
gis:apply-raster healthfacility-dataset healthfacility
;;gis:paint healthfacility-dataset 0
end
;;load distance to school
to load-school
set school-dataset gis:load-dataset "data/prox_school.accra.asc"
gis:apply-raster school-dataset school
;;gis:paint school-dataset 0
end
;;load distance to suburban centers
to load-suburbs
set suburban-dataset gis:load-dataset "data/prox_suburbancentres.asc"
gis:apply-raster suburban-dataset suburb
;;gis:paint suburban-dataset 0
end
;;load distance to shopping malls
to load-shoppingmalls
set shoppingmall-dataset gis:load-dataset "data/prox_shoppingmalls.asc"
gis:apply-raster shoppingmall-dataset shoppingmall
;;gis:paint shoppingmall-dataset 0
end
;;load distance to market
to load-market
set market-dataset gis:load-dataset "data/prox_markets.asc"
gis:apply-raster market-dataset market
;;gis:paint market-dataset 0
end
;;load distance to airport
to load-airport
set airport-dataset gis:load-dataset "data/prox_airport.asc"
gis:apply-raster airport-dataset airport
;;gis:paint airport-dataset 0
end
;;load distance to CBD
to load-cbd
set cbd-dataset gis:load-dataset "data/cbd.accra.asc"
gis:apply-raster cbd-dataset cbd
end
;;load distance to attractive neighbourhood
to load-attractive2015
set attractive2015-dataset gis:load-dataset "data/attractive2015.accra.asc"
gis:apply-raster attractive2015-dataset attractive2015
end
;; laod population density
to load-density
set density-dataset gis:load-dataset "data/density.accra.asc"
gis:apply-raster density-dataset density
;;gis:paint density-dataset 0
ask patches [set density-flip (1 - density)] ;; set patch values for density-flip
end
;; load administrative districts
to load-district
set district-dataset gis:load-dataset "data/districts.accra.asc"
gis:apply-raster district-dataset district
;;gis:paint district-dataset 0
end
;;.................................................
;;load built-up status of parcels
to load-urban
set urban-dataset gis:load-dataset "data/urban_accra.asc"
gis:apply-raster urban-dataset urban
;gis:set-world-envelope gis:envelope-of urban-dataset
ask patches [ifelse urban = 1 [ set pcolor brown ] [set pcolor green]]
end
;;Count and set the number of neighbouring parcels that are built-up
to load-neighbourhood
ask patches [set neighbourhood
count neighbors with [urban = 1]]
end
;; load distance to built-up areas
to load-prox-bu2010
set prox-bu2010-dataset gis:load-dataset "data/prox-bu2010.accra.asc"
gis:apply-raster prox-bu2010-dataset bu2010
end
;;.......................................................................
;;.......................................................................
;; COMPUTE THE SUITABILITY OF PARCELS
to load-suitability
set slope_max max [slope] of patches
set develop_prob []
let a 0
while [a <= critical_slope][
let b (critical_slope - a) / critical_slope
set develop_prob lput (b ^ (slope_coefficient / 200)) develop_prob
set a a + 1]
let i 1
while [i <= (slope_max - critical_slope)][
set develop_prob lput 0 develop_prob
set i i + 1]
ask patches [let y random-float 1
ifelse y < item (slope) develop_prob
[set suitability 1][set suitability 0]
if exclusion = 1 [set suitability 0]
if urban = 1 [set suitability 0]
]
end
;;.....................................................................
;; Display suitability
to display_suitability
ask patches [ifelse suitability = 1
[set pcolor white][set pcolor black]
]
end
;;.....................................................................
;; normalize slope
to load-nom-slope
ask patches [
let i max [slope] of patches
let j min [slope] of patches
set nom-slope ((slope - j) / (i - j))
]
end
;; normalize neighbourhood
to load-nom-neighbourhood
ask patches [set nom-neighbourhood ((neighbourhood)/(8))]
end
;;......................................................................................
;;......................................................................................
;; COMPUTE LEGAL STATUS OF PARCELS
;;Load areas liable to informal development
to load-informality
ask patches with [(suitability = 1) and (splan != 1 and splan != 4 and splan != 0)]
[set informality 1]
end
;;Display areas liable to informal development
to display-areas-liable-to-informality
let i count patches with [(informality = 1) and (suitability = 1) and (urban = 0)]
let j (development_control / 100) * i
;;ask n-of j patches with [informality = 1 and splan != 7] [set pcolor red]
ask n-of j patches with [(informality = 1) and (suitability = 1) and (urban = 0)] [set pcolor red]
end
;;load informal lands that are available for development
to load-informal-avail
let i count patches with [(informality = 1) and (suitability = 1) and (urban = 0)]
let j (development_control / 100) * i
ask n-of j patches with [(informality = 1) and (suitability = 1) and (urban = 0)]
[set informal_avail 1]
;; exclude the specified proportion of informal lands from development
end
;;..............................................................................
;;..............................................................................
;;ACTIVATE DEVELOPMENT CONTROL
to activate-development-control
let i count patches with[(informality = 1) and (suitability = 1) and (urban = 0)]
let j (development_control / 100) * i
ask n-of j patches with [(informality = 1) and (suitability = 1) and (urban = 0)]
[set suitability 0]
end
;;.......................................................................................
;;.......................................................................................
;; COMPUTE PARCEL UTILITY BY INCOME STATUS
;; load low income households utility for each parcel
to load-ULI
ask patches [
set ULI (((1 - suburb) * 10) + (nom-neighbourhood * 7) + ((1 - bu2010) * 9) + ((1 - cbd) * 5) + (1 - shoppingmall) +
((1 - market) * 6) + ((1 - road) * 8) + (density * 2) + ((1 - school) * 2) + ((1 - attractive2015) * 2) + (1 - healthfacility) + (random-float 0.1))
]
end
;;............................................................................................................
;;load high income household utility for each parcel
to load-UHI
ask patches [
set UHI (((1 - attractive2015) * 10 ) + ((1 - bu2010) * 5) + ((1 - nom-neighbourhood) * 5) + ((1 - suburb) * 2) +
((1 - shoppingmall) * 5) + ((1 - market) * 6) + ((1 - school) * 4) + ((1 - road) * 3) + ((1 - cbd) * 2) + (density) + (random-float 0.1))
]
end
;;.........................................................................
;;load mid income household utility for each patch / parcel
to load-UMI
ask patches [
set UMI (((1 - attractive2015) * 8) + (nom-neighbourhood * 7) + ((1 - bu2010) * 6) + ((1 - road) * 7) +
((1 - school) * 4) + ((1 - cbd) * 3) + ((1 - suburb) * 4) + ((1 - market) * 4) + ((1 - shoppingmall) * 2) +
(density * 2) + (1 - healthfacility) + (random-float 0.1))
]
end
;; compute utility for middle end real estate developers
to load-UMED
ask patches [
set UMED (((1 - road) * 8) + ((1 - suburb) * 7) + ((1 - attractive2015) * 7) + ((1 - nom-slope) * 7) + ((1 - school) * 5))
]
end
;; compute utility for high end real estate developers
to load-UHED
ask patches [
set UHED (((1 - road) * 8) + ((1 - suburb) * 6) + ((1 - attractive2015) * 10) + ((1 - school) * 5))
]
end
;;........................................................................................................................................
;;........................................................................................................................................
;; PARCEL SELECTION/DEVELOPMENT BY HOUSEHOLDS
;; Development by low income households
to make-low-income-household-development
let i household-number
let n percent-low-income-households
let x ((i / simulation-period) * ( n / 100)) ;; the number of low-income households who enter the market annually between 2000 and 2010
let d patches with [(urban = 0) and (new-urban = 0) and (suitability = 1) and (landvalue < 2)]
;;ask max-n-of (x + (count d) / 20) d [ULI] [set first-n-ULI 1]
ask max-n-of (x * 3) d [ULI] [set first-n-ULI 1]
ask n-of x households with [income-status = 1 and LIH-movement = 0][
move-to one-of patches with
[((first-n-ULI = 1) and (LI-movement = 0) and (HI-movement = 0) and
(MI-movement = 0) and (pMED-movement = 0) and (pHED-movement = 0))]
ask patch-here
[(set pcolor yellow) (set LI-movement 1) (set new-urban 1)]
set LIH-movement 1
set color yellow
]
end
;;..................................................................
;; Development by middle income households
to make-mid-income-household-development
let i household-number
let n percent-mid-income-households
let x ((i / simulation-period) * ( n / 100))
let d patches with [(urban = 0) and (new-urban = 0) and (suitability = 1) and (landvalue < 3)]
ask max-n-of (x * 3) d [UMI] [set first-n-UMI 1]
ask n-of x households with [income-status = 2 and MIH-movement = 0] [
move-to one-of patches with [(first-n-UMI = 1) and (MI-movement = 0)
and (HI-movement = 0) and (LI-movement = 0) and (pMED-movement = 0) and (pHED-movement = 0)]
ask patch-here
[(set pcolor orange) (set MI-movement 1) (set new-urban 1)]
set MIH-movement 1
set color orange
]
end
;;........................................................................................................................................
;;Make high income development
to make-high-income-household-development
let i household-number
let n percent-high-income-households
let x ((i / simulation-period) * ( n / 100))
let d patches with [(urban = 0) and (new-urban = 0) and (suitability = 1)]
ask max-n-of (x * 3) d [UHI] [set first-n-UHI 1]
ask n-of x households with [income-status = 3 and HIH-movement = 0] [
move-to one-of patches with [(first-n-UHI = 1) and
(HI-movement = 0) and (MI-movement = 0)and (LI-movement = 0) and (pMED-movement = 0) and (pHED-movement = 0)]
ask patch-here [(set pcolor blue) (set HI-movement 1) (set new-urban 1)]
set HIH-movement 1
set color blue
]
end
;; Developments by high-end real estate developers
to make-high-end-RED
let i estate-developer-number
let n percent-high-end-developers
let x ((i / simulation-period) * ( n / 100))
let y (median [UHED] of patches with [ suitability = 1 and district > 0])
let q (2 + random 4)
let d patches with [(urban = 0) and (new-urban = 0) and (suitability = 1)]
ask max-n-of (x * 2) d [UHED] [set first-n-UHED 1]
ask n-of x developers with [(class = 3) and (HED-movement = 0)] [
move-to one-of patches with [(first-n-UHED = 1) and (pHED-movement = 0)
and (pMED-movement = 0) and (HI-movement = 0)and (MI-movement = 0)and (LI-movement = 0)]
ask patch-here
[
ask n-of q patches in-radius 2
[
if suitability = 1 and urban = 0 and new-urban = 0
[
(set pcolor blue) (set pHED-movement 1) (set new-urban 1)
]
]
set pcolor blue
set new-urban 1
set pHED-movement 1
]
(set HED-movement 1) (set color blue)
]
end
;; Developments by mid end real estate developers
to make-mid-end-RED
let i estate-developer-number
let n percent-mid-end-developers
let x ((i / simulation-period) * ( n / 100))
let y (median [UMI] of patches with [suitability = 1 and district > 0])
let w (2 + random 6)
let d patches with [(urban = 0) and (new-urban = 0) and (suitability = 1)]
;;ask max-n-of (x + (count d)/ 20) d [UMED] [set first-n-UMED 1]
ask max-n-of (x * 2) d [UMED] [set first-n-UMED 1]
ask n-of x developers with [class = 2 and MED-movement = 0] [
move-to one-of patches with
[
(first-n-UMED = 1) and (pMED-movement = 0) and (pHED-movement = 0)
and (HI-movement = 0)and (MI-movement = 0)and (LI-movement = 0)
]
ask patch-here
[
ask n-of w patches in-radius 3
[
if suitability = 1 and urban = 0 and new-urban = 0
[
(set pcolor orange) (set pMED-movement 1) (set new-urban 1)
]
]
set pcolor orange
set pMED-movement 1
set new-urban 1
]
(set MED-movement 1) (set color orange)
]
;;..............................................................................................................
end
;;...................................................................................................................................................
;;...................................................................................................................................................
;;UPDATE-NEIGHBOURHOOD
to update-neighbourhood
ask patches with [(new-urban = 0) and (suitability = 1)] [ if ((count neighbors with [LI-movement = 1] >= 3 ) and (first-n-ULI = 0))
[
set first-n-ULI 1
set landvalue 1
set first-n-UMI 0
set first-n-UHI 0
]
if ((count neighbors with [LI-movement = 1] >= 3 ) and (landvalue > 1))
[
set landvalue 1
set first-n-ULI 1
set first-n-UMI 0
set first-n-UHI 0
]
if ((count neighbors with [HI-movement = 1] >= 3) and (first-n-UHI = 0))
[
set first-n-UHI 1
set first-n-ULI 0
set first-n-UMI 0
]
if ((count neighbors with [MI-movement = 1] >= 3 ) and (first-n-UMI = 0))
[
set first-n-UMI 1
set landvalue 2
set first-n-UHI 0
set first-n-ULI 0
]
if ((count neighbors with [MI-movement = 1] >= 3 ) and (landvalue > 2))
[
set landvalue 2
set first-n-UMI 1
set first-n-UHI 0
set first-n-ULI 0
]
]
end
;;......................................................................................
;;......................................................................................
;; EXPORT OUTPUT
to export-output-income-status
file-close
;;file-delete "Output/Income_status/urban_expansion_income_2030.asc"
file-open "Output/Income_status/urban_expansion_income_2030.asc"
file-print "ncols 886"
file-print "nrows 536"
file-print "xllcorner 730915.48888016"
file-print "yllcorner 577823.10587025"
file-print "cellsize 200"
file-print "NODATA_value -9999"
let i 535
while [i > -1]
[ set rows []
set rows patches with [pycor = i]
foreach sort-on [pxcor] rows [ ?1 -> ask ?1 [
if pcolor = yellow [file-write 1] ;; low income
if pcolor = orange [file-write 2] ;; middle income
if pcolor = blue [file-write 3] ;; high income
if pcolor = green [file-write 0] ;; undeveloped lands
if pcolor = brown [file-write 4] ] ] ;; seed year built-up
file-print " "
set i i - 1]
end
to export-output-legal-status
file-close
;;file-delete "Output/formality_status/formality_2030.asc"
file-open "Output/formality_status/formality_2030.asc"
file-print "ncols 886 \r\n"
file-print "nrows 536 \r\n"
file-print "xllcorner 730915.48888016 \r\n"
file-print "yllcorner 577823.10587025 \r\n"
file-print "cellsize 200 \r\n"
file-print "NODATA_value -9999 \r\n"
let i 535
while [i > -1]
[ set rows []
set rows patches with [pycor = i]
foreach sort-on [pxcor] rows [ ?1 -> ask ?1 [
if new-urban = 1 and informality = 1 [file-write 1] ;; informal development
if new-urban = 1 and informality = 0 [file-write 2] ;; formal development
if pcolor = green [file-write 0] ;; undeveloped lands
if pcolor = brown [file-write 6] ] ] ;; seed year built-up
file-print " \r\n"
set i i - 1]
end
@#$#@#$#@
GRAPHICS-WINDOW
289
10
1175
555
-1
-1
0.99
1
10
1
1
1
0
0
0
1
0
885
0
535
0
0
1
ticks
30.0
BUTTON
214
10
283
43
Set-up
set-up
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
217
53
280
86
Go
go
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
0
SLIDER
5
327
177
360
slope_coefficient
slope_coefficient
1
100
11.0
1
1
NIL
HORIZONTAL
SLIDER
5
358
177
391
critical_slope
critical_slope
1
100
25.0
1
1
NIL
HORIZONTAL
BUTTON
6
469
134
502
display suitability
display_suitability
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
SLIDER
5
392
177
425
development_control
development_control
0
100
10.0
1
1
NIL
HORIZONTAL
BUTTON
5
434
180
467
Display Areas liable to informality
display-areas-liable-to-informality
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
SLIDER
7
11
213
44
household-number
household-number
100
50000
22320.0
100
1
NIL
HORIZONTAL
SLIDER
8
46
198
79
percent-Low-income-households
percent-Low-income-households
0
100
52.0
1
1
NIL
HORIZONTAL
SLIDER
7
117
199
150
percent-high-income-households
percent-high-income-households
0
100
9.0
1
1
NIL
HORIZONTAL
SLIDER
8
82
199
115
percent-mid-income-households
percent-mid-income-households
0
100
39.0
1
1
NIL
HORIZONTAL
PLOT
1188
17
1372
213
Percent Informal
Years
Percent
0.0
10.0
0.0
100.0
true
false
"" ""
PENS
"default" 1.0 0 -2674135 true "" "plot ((count patches with [(informality = 1) and (new-urban = 1)]) / (1 + count patches with [new-urban = 1])) * 100"
MONITOR
1217
213
1322
258
Percent Informal
((count patches with [(informality = 1) and (new-urban = 1)]) / (1 + count patches with [new-urban = 1])) * 100
2
1
11
PLOT
1384
17
1816
214
Percent Informal of Income Types
Years