Making States in a GIS file become and act as Turtles in Netlogo

心不动则不痛 提交于 2019-12-11 07:58:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!