问题
I have a general model that uses turtles on patches as cities/states in the NetLogo world. I would like to extend the general model to a specific country. I have imported the GIS map into NL. How do I map states in the GIS map to the turtles in NetLogo, so I can run the general model using the exact space/world and data of a specific country?
So for example, in my general model, I create one turtle per patch, assign it variables, perform some analysis and get an output. What I now want to do is to assign variables to each state in the GIS map i.e. make each state in the country on the GIS map a turtle/breed, perform analysis based upon the variables assignment and calculation, take action e.g. kill a state or hatch a state or move a state just as I would kill a turtle, hatch a turtle, move a turtle in my general model based on the NetLogo world.
I hope my question and what I am trying to achieve is clear.
Thank you.
So far all I have been able to do is to load the GIS map into Netlogo. I can see the map and the states of the country defined in Netlogo but I am stuck at getting the states in the map become Netlogo turtles so i can run my model!
here is my code.
extensions [ gis ]
globals [ MYCOUNTRY slope aspect ]
to setup
clear-all
ask patches [ set pcolor green ]
gis:load-coordinate-system ("data/CTRY_adm/CTRY_adm1.prj")
set MYCOUNTRY gis:load-dataset "data/CTRY_adm/CTRY-level_1.shp"
gis:set-world-envelope gis:envelope-of MYCOUNTRY
gis:set-drawing-color white
gis:draw MYCOUNTRY 3
reset-ticks
end
来源:https://stackoverflow.com/questions/25397271/making-states-in-a-gis-file-become-and-act-as-turtles-in-netlogo