Urban Region Toy
Model was written in NetLogo 6.1.1
•
Viewed 328 times
•
Downloaded 39 times
•
Run 0 times
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
;::::::::::::::::::::::::::::::::::::::::U R B A N R E G I O N T O Y:::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::::::::::::::::::::::::Code: Dr. Javier Sadoval Felix::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::::::::::::::::::::::::Contact: jarquisol@gmail.com::::::::::::::::::::::::::::::::::::::::::: extensions [rnd] patches-own [ potential new-potential interest urban? slope] globals [ %Residential %Commercial %Industrial %Tourism %R-C %C-I %Equipment probability-list fitness threshold ] to setup clear-all set threshold 4 ifelse Restrictions? [ask patches [ set potential one-of [1 -1] ] set probability-list (list (list "Residential" Residential) (list "Commercial" Commercial) (list "Industrial" Industrial) (list "Tourism" Tourism) (list "H-C" Residential-Commercial) (list "C-I" Commercial-Industrial) (list "Equipment" Equipment)) setup-patches set fitness ((max [slope] of patches) - (min [slope] of patches))] [ask patches [ set potential one-of [1 -1] ] set probability-list (list (list "Residential" Residential) (list "Commercial" Commercial) (list "Industrial" Industrial) (list "Tourism" Tourism) (list "H-C" Residential-Commercial) (list "C-I" Commercial-Industrial) (list "Equipment" Equipment)) ] reset-ticks end to go estimate-% if (Residential + Commercial + Industrial + Tourism + Residential-Commercial + Commercial-Industrial + Equipment) != 100 [user-message "Suma de porcentajes de uso no es igual a 100%" stop] ask patches with [pcolor = white] [ask neighbors [set potential (potential + one-of [1 -1])]] ask patches [ set new-potential (potential + sum [potential] of neighbors4) / 5 + one-of [1 -1] ] ask patches [ set potential new-potential if potential > threshold and urban? = 0 and slope >= ((min [slope] of patches) + (fitness / 2)) [set interest first rnd:weighted-one-of-list probability-list last] if interest = "Residential" and count patches in-radius Tolerance-radius with [interest = "Industrial" or interest = "C-I"] = 0 [set pcolor yellow set urban? 1] if interest = "Commercial" and (count patches in-radius Tolerance-radius with [interest = "Industrial"] = 0) [set pcolor red set urban? 1] if interest = "Industrial" and (count patches in-radius Tolerance-radius with [interest = "Residential" or interest = "H-C" = 0 or interest = "Tourism" or interest = "Commercial"] = 0) [set pcolor violet set urban? 1] if interest = "Tourism" and (count patches in-radius Tolerance-radius with [interest = "Industrial" or interest = "C-I" or interest = "Equipment"] = 0) [set pcolor pink set urban? 1] if interest = "H-C" and (count patches in-radius Tolerance-radius with [interest = "Industrial" or interest = "C-I"] = 0) [set pcolor orange set urban? 1] if interest = "C-I" and (count patches in-radius Tolerance-radius with [interest = "Residential" or interest = "Tourism" or interest = "H-C"] = 0) [set pcolor brown set urban? 1] if interest = "Equipment" and (count patches in-radius Tolerance-radius with [interest = "Tourism"] = 0) [set pcolor blue set urban? 1]] tick end to Hab if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor yellow set urban? 1 set interest "Residential"]] display end to Com if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor red set urban? 1 set interest "Commercial"]] display end to Ind if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor violet set urban? 1 set interest "Industrial"]] display end to Equi if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor blue set urban? 1 set interest "Equipment"]] end to Tur if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor pink set urban? 1 set interest "Tourism"]] display end to Hab-Com if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor orange set urban? 1 set interest "H-C"]] display end to Com-Ind if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor brown set urban? 1 set interest "C-I"]] display end to Road if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor white set urban? 1 set interest 0]] display end to No-urb if mouse-down? [ask patch mouse-xcor mouse-ycor [ set pcolor gray set urban? 1]] display end to setup-patches ask patches [set slope ( random 15 )] repeat 70 [diffuse slope 1] ask patches [set pcolor scale-color green slope 7 6] end to estimate-% if count patches with [pcolor = yellow] != 0 [set %Residential (count patches with [pcolor = yellow] * 100) / (count patches with [pcolor = yellow or pcolor = red or pcolor = violet or pcolor = pink or pcolor = orange or pcolor = brown or pcolor = blue])] if count patches with [pcolor = red] != 0 [set %Commercial (count patches with [pcolor = red] * 100) / (count patches with [pcolor = yellow or pcolor = red or pcolor = violet or pcolor = pink or pcolor = orange or pcolor = brown or pcolor = blue])] if count patches with [pcolor = violet] != 0 [set %Industrial (count patches with [pcolor = violet] * 100) / (count patches with [pcolor = yellow or pcolor = red or pcolor = violet or pcolor = pink or pcolor = orange or pcolor = brown or pcolor = blue])] if count patches with [pcolor = pink] != 0 [set %Tourism (count patches with [pcolor = pink] * 100) / (count patches with [pcolor = yellow or pcolor = red or pcolor = violet or pcolor = pink or pcolor = orange or pcolor = brown or pcolor = blue])] if count patches with [pcolor = orange] != 0 [set %R-C (count patches with [pcolor = orange] * 100) / (count patches with [pcolor = yellow or pcolor = red or pcolor = violet or pcolor = pink or pcolor = orange or pcolor = brown or pcolor = blue])] if count patches with [pcolor = brown] != 0 [set %C-I (count patches with [pcolor = brown] * 100) / (count patches with [pcolor = yellow or pcolor = red or pcolor = violet or pcolor = pink or pcolor = orange or pcolor = brown or pcolor = blue])] if count patches with [pcolor = blue] != 0 [set %Equipment (count patches with [pcolor = blue] * 100) / (count patches with [pcolor = yellow or pcolor = red or pcolor = violet or pcolor = pink or pcolor = orange or pcolor = brown or pcolor = blue])] end
There is only one version of this model, created about 5 years ago by Javier Sandoval.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Urban Region Toy.png | preview | Preview for 'Urban Region Toy' | about 5 years ago, by Javier Sandoval | Download |
This model does not have any ancestors.
This model does not have any descendants.