Shenzhen Urban Village Simulation

Shenzhen Urban Village Simulation preview image

1 collaborator

Default-person Tong Wu (Author)

Tags

深圳城中村 

Tagged by 陈 小 9 months ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.4 • Viewed 187 times • Downloaded 6 times • Run 0 times
Download the 'Shenzhen Urban Village Simulation' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [affordable-patches affordable-for-formals affordable-for-villagers]

breed [formals formal]      ;a breed for formal community residents (high affordabilituy)
breed [villagers villager]   ; a breed for village residents (low financial-capacity)
breed [new_vs new_v]
breed [new_fs new_f]
breed [deads dead]

patches-own
[
  street                   ; the patch a street or not
  key-transit              ; major transportation line
  rent-value               ; a measure of proximity to transit and thypes of residence
  Parcel                   ; village, formal or park
  block                    ; block identity, center parcel to define parcels with in a block, 1 or o
  block_type               ; formal or village
  landuse                  ; what is built on a patch
  CBD_Dist                 ; measure and scale distance
  CBD_Metric               ; metric for CBD distance
  Transit_Dist             ; mesure of distance to key transit line
  Transit_Metric           ; metric of transit distance
  Density
]

Villagers-own
[financial-capacity]             ; place holder for renters

Formals-own
[financial-capacity]             ; place holder for renters

to setup
  ca
;????proportion of block are formal gated communities

;set up streets and key transit lines
  ask patches with [pxcor != 0 and pycor != 0 or pycor = 1 ]
  [
    if abs pxcor mod 6 = 0 or pycor mod 6 = 0
    [set pcolor 7 set street 1]
    ask patches with [pxcor = 0 or pycor = 0 ]
    [set pcolor 6 set street 1 set key-transit 1]
  ]

;set up blocks
  ask patches with [abs pxcor mod 6 = 3 and pycor mod 6 = 3]
      [set block 1]


;set up formal blocks--
  ask n-of (count patches with [block = 1]* .60) patches with [block = 1]
      [set block_type "formal"]
  ask patches with [street = 0 and
                   count patches with [block_type = "formal"] in-radius 3 = 1 and
                   count patches with [street = 1] in-radius 1 > 0]
      [set parcel "formal"]
  ask patches with [parcel = 0 and count patches with [block_type = "formal"] in-radius 2 = 1]
      [set parcel "park"]


;set up village blocks
 ask patches with [block = 1 and
                   block_type = 0]
      [set block_type "village"]
 ask patches with [street = 0 and
                   count patches with [block_type = "village"] in-radius 3 = 1]
      [set parcel "village"]


;set up color
  ask patches with [parcel = "formal"] [set pcolor 135]
  ask patches with [parcel = "park"] [set pcolor 8]
  ask patches with [parcel = "village"] [set pcolor 137]
  ask patches with [parcel ="formal" or parcel = "village"] [set landuse "residential"]
end 

to create-renter-points ;with financial-capacity reflected from current rent value
; sprout formal renters with financial-capacity (formal patch: capacity 3)
 Ask n-of (count patches with [parcel = "formal"] * occupancy) patches with [parcel = "formal"] [sprout-formals 3]

 Ask formals
  [
   Set color white
   Set shape "circle"
   Set size .7
  ]

;sprout village renters with financial-capacity (village patch capacity 1)
 Ask n-of (count patches with [parcel = "village"] * occupancy) patches with [parcel = "village"] [sprout-villagers 1]
 Ask villagers
  [
   Set color white
   Set shape "x"
   Set size .7
  ]


;density
 ask patches
  [set density count turtles-here]
end 

to calculate-rent-value

  ask patches with [parcel = "formal" or parcel = "village"]
  [
    ;access to CBD
    set CBD_Dist distance patch 0 0
    ;acces to key transit
    set Transit_Dist distance min-one-of patches with [key-transit = 1] [distance myself]
  ]

  ;CBD and transit Metric for formal
let a sort [CBD_Dist] of patches with [parcel = "formal"]
  let nlist length a print nlist
  ask patches with [parcel = "formal" and CBD_Dist <= item (0.1 * (nlist + 1)) a] [set CBD_Metric 20]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.1 * (nlist + 1)) a and CBD_Dist <= item (0.2 * (nlist + 1)) a] [set CBD_Metric 18]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.2 * (nlist + 1)) a and CBD_Dist <= item (0.3 * (nlist + 1)) a] [set CBD_Metric 16]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.3 * (nlist + 1)) a and CBD_Dist <= item (0.4 * (nlist + 1)) a] [set CBD_Metric 14]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.4 * (nlist + 1)) a and CBD_Dist <= item (0.5 * (nlist + 1)) a] [set CBD_Metric 12]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.5 * (nlist + 1)) a and CBD_Dist <= item (0.6 * (nlist + 1)) a] [set CBD_Metric 10]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.6 * (nlist + 1)) a and CBD_Dist <= item (0.7 * (nlist + 1)) a] [set CBD_Metric 8]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.7 * (nlist + 1)) a and CBD_Dist <= item (0.8 * (nlist + 1)) a] [set CBD_Metric 6]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.8 * (nlist + 1)) a and CBD_Dist <= item (0.9 * (nlist + 1)) a] [set CBD_Metric 4]
  ask patches with [parcel = "formal" and CBD_Dist > item (0.9 * (nlist + 1)) a] [set CBD_Metric 2]

let b sort [transit_Dist] of patches with [parcel = "formal"]
  let nlist2 length b
  ask patches with [parcel = "formal" and transit_Dist <= item (0.1 * (nlist2 + 1)) b] [set transit_Metric 20]
  ask patches with [parcel = "formal" and transit_Dist > item (0.1 * (nlist2 + 1)) b and transit_Dist <= item (0.2 * (nlist2 + 1)) b] [set transit_Metric 18]
  ask patches with [parcel = "formal" and transit_Dist > item (0.2 * (nlist2 + 1)) b and transit_Dist <= item (0.3 * (nlist2 + 1)) b] [set transit_Metric 16]
  ask patches with [parcel = "formal" and transit_Dist > item (0.3 * (nlist2 + 1)) b and transit_Dist <= item (0.4 * (nlist2 + 1)) b] [set transit_Metric 14]
  ask patches with [parcel = "formal" and transit_Dist > item (0.4 * (nlist2 + 1)) b and transit_Dist <= item (0.5 * (nlist2 + 1)) b] [set transit_Metric 12]
  ask patches with [parcel = "formal" and transit_Dist > item (0.5 * (nlist2 + 1)) b and transit_Dist <= item (0.6 * (nlist2 + 1)) b] [set transit_Metric 10]
  ask patches with [parcel = "formal" and transit_Dist > item (0.6 * (nlist2 + 1)) b and transit_Dist <= item (0.7 * (nlist2 + 1)) b] [set transit_Metric 8]
  ask patches with [parcel = "formal" and transit_Dist > item (0.7 * (nlist2 + 1)) b and transit_Dist <= item (0.8 * (nlist2 + 1)) b] [set transit_Metric 6]
  ask patches with [parcel = "formal" and transit_Dist > item (0.8 * (nlist2 + 1)) b and transit_Dist <= item (0.9 * (nlist2 + 1)) b] [set transit_Metric 4]
  ask patches with [parcel = "formal" and transit_Dist > item (0.9 * (nlist2 + 1)) b] [set transit_Metric 2]



 ;CND and transit Metric for village
let c sort [CBD_Dist] of patches with [parcel = "village"]
  let nlist3 length c print nlist3
  ask patches with [parcel = "village" and CBD_Dist <= item (0.1 * (nlist3 + 1)) c] [set CBD_Metric 10]
  ask patches with [parcel = "village" and CBD_Dist > item (0.1 * (nlist3 + 1)) c and CBD_Dist <= item (0.2 * (nlist3 + 1)) c] [set CBD_Metric 9]
  ask patches with [parcel = "village" and CBD_Dist > item (0.2 * (nlist3 + 1)) c and CBD_Dist <= item (0.3 * (nlist3 + 1)) c] [set CBD_Metric 8]
  ask patches with [parcel = "village" and CBD_Dist > item (0.3 * (nlist3 + 1)) c and CBD_Dist <= item (0.4 * (nlist3 + 1)) c] [set CBD_Metric 7]
  ask patches with [parcel = "village" and CBD_Dist > item (0.4 * (nlist3 + 1)) c and CBD_Dist <= item (0.5 * (nlist3 + 1)) c] [set CBD_Metric 6]
  ask patches with [parcel = "village" and CBD_Dist > item (0.5 * (nlist3 + 1)) c and CBD_Dist <= item (0.6 * (nlist3 + 1)) c] [set CBD_Metric 5]
  ask patches with [parcel = "village" and CBD_Dist > item (0.6 * (nlist3 + 1)) c and CBD_Dist <= item (0.7 * (nlist3 + 1)) c] [set CBD_Metric 4]
  ask patches with [parcel = "village" and CBD_Dist > item (0.7 * (nlist3 + 1)) c and CBD_Dist <= item (0.8 * (nlist3 + 1)) c] [set CBD_Metric 3]
  ask patches with [parcel = "village" and CBD_Dist > item (0.8 * (nlist3 + 1)) c and CBD_Dist <= item (0.9 * (nlist3 + 1)) c] [set CBD_Metric 2]
  ask patches with [parcel = "village" and CBD_Dist > item (0.9 * (nlist3 + 1)) c] [set CBD_Metric 1]

let d sort [transit_Dist] of patches with [parcel = "village"]
  let nlist4 length d
  ask patches with [parcel = "village" and transit_Dist <= item (0.1 * (nlist4 + 1)) d] [set transit_Metric 10]
  ask patches with [parcel = "village" and transit_Dist > item (0.1 * (nlist4 + 1)) d and transit_Dist <= item (0.2 * (nlist4 + 1)) d] [set transit_Metric 9]
  ask patches with [parcel = "village" and transit_Dist > item (0.2 * (nlist4 + 1)) d and transit_Dist <= item (0.3 * (nlist4 + 1)) d] [set transit_Metric 8]
  ask patches with [parcel = "village" and transit_Dist > item (0.3 * (nlist4 + 1)) d and transit_Dist <= item (0.4 * (nlist4 + 1)) d] [set transit_Metric 7]
  ask patches with [parcel = "village" and transit_Dist > item (0.4 * (nlist4 + 1)) d and transit_Dist <= item (0.5 * (nlist4 + 1)) d] [set transit_Metric 6]
  ask patches with [parcel = "village" and transit_Dist > item (0.5 * (nlist4 + 1)) d and transit_Dist <= item (0.6 * (nlist4 + 1)) d] [set transit_Metric 5]
  ask patches with [parcel = "village" and transit_Dist > item (0.6 * (nlist4 + 1)) d and transit_Dist <= item (0.7 * (nlist4 + 1)) d] [set transit_Metric 4]
  ask patches with [parcel = "village" and transit_Dist > item (0.7 * (nlist4 + 1)) d and transit_Dist <= item (0.8 * (nlist4 + 1)) d] [set transit_Metric 3]
  ask patches with [parcel = "village" and transit_Dist > item (0.8 * (nlist4 + 1)) d and transit_Dist <= item (0.9 * (nlist4 + 1)) d] [set transit_Metric 2]
  ask patches with [parcel = "village" and transit_Dist > item (0.9 * (nlist4 + 1)) d] [set transit_Metric 1]

;


; calculate rent value
ask patches with [parcel = "formal" or parcel = "village"]
  [
    set rent-value (CBD_Metric * CBD_Multiplier)+(transit_Metric * transit_Multiplier)
  ]
end 

to update-rent-value
;calculate-new-rent
  ask patches with [parcel = "village"]
  [ set rent-value
    count turtles-on patches with [parcel = "village"] / count patches with [parcel = "village"]/ occupancy * rent-value
  ]

  ask patches with [parcel = "formal"]
  [ set rent-value
    count turtles-on patches with [parcel = "formal"] / (count patches with [parcel = "formal"] * 3 )/ occupancy * rent-value
  ]
end 

to calculate-financial-capacity

  ask formals [set financial-capacity [rent-value] of patch-here * financial-multiplier]
  ask villagers[set financial-capacity [rent-value] of patch-here * financial-multiplier]

 ;20% village renters can afford higher rents
  ask n-of (count villagers * 0.2) villagers
     [set financial-capacity [rent-value] of patch-here * 1.5]
end 

to develop

;develop a village
 let development-point max-one-of patches with [block_type = "village"] [rent-value]

 ask patches with [parcel = "village" and
                   distance development-point < 4 and
                   count patches with [street = 1] in-radius 1 > 0]
      [set parcel "formal" set rent-value rent-value * 2 set pcolor 84]

 ask patches with [parcel = "village" and
                   distance development-point < 4]
    [set parcel "park" set landuse 0 set rent-value 0 set pcolor 8 ]

 ask development-point [set block_type "formal"]



;displaced villagers
ask villagers with [distance development-point < 4]

  [
      set affordable-patches patches with
         [landuse = "residential" and
          count villagers-here < 1 and
          count formals-here < 3 and
          rent-value < [financial-capacity] of myself ]

    ifelse any? affordable-patches
        [
          move-to min-one-of affordable-patches [distance myself]
           ifelse [parcel] of patch-here  = "formal"
               [set breed formals set color 87 set shape "circle"]
               [set breed villagers set color 87 set shape "x"]
        ]
        [move-to patch 30 30 set color red set breed deads] ;die
 ]
end 

to grow ;new comers and update financial-capacity

;new comers

;new formal residents
  ifelse (count patches with [parcel = "formal"] * 3 - count formals-on patches with [landuse = "residential"]) >= (increase_rate * count formals * 0.4)
       [ ask patch -30 -30
          [sprout-new_fs (increase_rate * count formals * 0.4)]
         ask new_fs [
                      move-to one-of patches with
                          [parcel = "formal" and count formals-here < 3]
                     ]
       ]
       [ ask patches with [parcel = "formal"]  ;no enough housing available: rent increases
            [set rent-value rent-value * 1.05]

         if any? patches with [parcel = "formal" and count formals-here < 3]
           [ask patch -30 -30
               [sprout-new_fs (count patches with [parcel = "formal"] * 3 - count formals-on patches with [landuse = "residential"])]
            ask new_fs [
                          move-to one-of patches with
                           [parcel = "formal" and count formals-here < 3]
                        ]
             ]
       ]
  ask new_fs
     [
      Set color yellow
      Set size .7
      set breed formals
      set shape "circle"
      set financial-capacity [rent-value] of patch-here * financial-multiplier
     ]



;new villagers
  ifelse count patches with [parcel = "village" and count villagers-here = 0] >= (increase_rate * count villagers * 0.6)
        [
            ask n-of (increase_rate * count villagers * 0.6) patches with
              [parcel = "village" and count villagers-here = 0]
                  [sprout-new_vs 1]
        ]
        [ ask patches with [parcel = "village"]   ;if not enough space available, rent increses)
            [set rent-value rent-value * 1.05]
          if any? patches with [parcel = "village" and count villagers-here = 0]
          [ask patches with [parcel = "village" and count villagers-here = 0]
               [sprout-new_vs 1]
          ]
        ]

  ask new_vs
  [
   Set color yellow
   Set size .7
   set breed villagers
    set shape "x"
    set financial-capacity [rent-value] of patch-here * financial-multiplier
  ]
end 

to impact-relocation  ;if rent value here becomes larger than financial-capacity, turtle would relocate or die

update-rent-value

; capacity update
ask formals [set financial-capacity financial-capacity * 1.1]
ask villagers [set financial-capacity financial-capacity * 1.1]


; impacted villagers

 ask villagers
  [
    set affordable-for-villagers patches with
         [landuse = "residential" and
          count villagers-here < 1 and
          count formals-here < 3 and
          rent-value < [financial-capacity] of myself ]

    if [financial-capacity] of self < [rent-value] of patch-here

        [ifelse any? affordable-for-villagers
          [
            move-to min-one-of affordable-for-villagers [distance myself]
              ifelse [parcel] of patch-here  = "formal"
               [set breed formals set color 87 set shape "circle"]
               [set breed villagers set color 87 set shape "x"]
          ]
          [move-to patch 30 30 set color red set breed deads] ;die
         ]
   ]

;impacted formal residents
ask formals
  [
    set affordable-for-formals patches with
    [landuse = "residential" and
      count villagers-here < 1 and
      count formals-here < 3 and
      rent-value < [financial-capacity] of myself]

    if [financial-capacity] of self < [rent-value] of patch-here

        [ifelse any? affordable-for-formals
          [
            move-to min-one-of affordable-for-formals [distance myself]
              ifelse [parcel] of patch-here  = "formal"
               [set breed formals set color 87 set shape "circle"]
               [set breed villagers set color 87 set shape "x"]
          ]
          [move-to patch 30 30 set color red set breed deads] ;die
         ]

 ]

;density
  ask patches
  [set density count turtles-here]
end 

to show-rent-value
  ask patches
    [
      set pcolor scale-color 116 rent-value min [rent-value] of patches  max [rent-value] of patches
    ]
end 

to show-financial-capacity
ask turtles-on patches with [landuse = "residential"]
    [
        set color scale-color 116 financial-capacity
        min [financial-capacity] of turtles-on patches with [landuse = "residential"]
        max [financial-capacity] of turtles-on patches with [landuse = "residential"]
    ]
end 

to show-density
  ask patches with [landuse = "residential"]
    [
      set pcolor scale-color grey count turtles-here 0 3
    ]
end 

to output-death
output-print count turtles-on patch 30 30
end 

to setup-plot
 setup-plots
end 

to plot-result
update-plots
end 

There is only one version of this model, created about 4 years ago by Tong Wu.

Attached files

File Type Description Last updated
Shenzhen Urban Village Simulation.png preview Preview for 'Shenzhen Urban Village Simulation' about 4 years ago, by Tong Wu Download

This model does not have any ancestors.

This model does not have any descendants.