问题
so im making a netlogo project using GIS shape files.
i have a big point layer that represent places in a city like restaurants and gas stations.
i need my turtles to go in the direction of the points for example: turtle pops at the housing area go to a random restaurant, heads to the nearst gas station and comes back home.
i found "foreach (gis:property-value ?)" that runs on the table and made the points scale by color and objectID to ensure it works. so now i can run on the column and the value but i dont know how to make a turtle move forward to the specific point. can i make it change its heading in the points direction or its direction to the patch the points sits on?
the project im mkaing is a 24 hour simulation that shows population movement in 7 city districts.
i have a polygon/vector layers dividing the city and i want to make turtles from certain districts to not be able to leave them unless a special action happens. is there a way to make specific turtles stay in the polygon/vector lines?
回答1:
I am not sure if this is the best way to do it, but I would probably approach this question by creating turtles at each of the places you want to be represented. I'd probably do it as a single breed and just have an attribute that says what type of place it is. You can hide the turtles so they are not visible on the interface.
The advantage of this approach is that then you can use all the native NetLogo primitives to do things like find a random restaurant within some radius and move towards it, instead of having to convert to the GIS layer. That is, you would only need to deal with GIS once (to create the turtles), which should deliver significant efficiency benefits.
来源:https://stackoverflow.com/questions/46771767/making-turtles-move-to-gis-points