【问题标题】:How can I get agents to interact with the attributes of a shapefile in NetLogo如何让代理与 NetLogo 中 shapefile 的属性进行交互
【发布时间】:2016-04-14 16:02:38
【问题描述】:

在我的 NetLogo 模型中,我已经加载了一个形状文件

set map gis:load-dataset "land_use.shp"
  gis:set-world-envelope gis:envelope-of map

我可以根据形状文件的属性是在水上还是在陆地上,如下所示:

foreach gis:feature-list-of map
[if gis:property-value ? "CODE_12" = "523" [ gis:set-drawing-color blue gis:fill ? 2.0]
if gis:property-value ? "CODE_12" = "522" [ gis:set-drawing-color green  gis:fill ? 2.0]
if gis:property-value ? "CODE_12" = "521" [ gis:set-drawing-color green  gis:fill ? 2.0] ]

完成后,如何让我的代理根据颜色与补丁进行交互?

例如,在没有 GIS 数据的标准模型中,我可以有类似的东西:

if [pcolor] of patch-here = blue [set size 2] 

谢谢

【问题讨论】:

    标签: gis netlogo


    【解决方案1】:

    我找到了解决问题的方法:

    to check
    let estuaries gis:find-features map "CODE_12" "522"
    if gis:intersects? estuaries self [
    set color red
    ]
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-03
      • 1970-01-01
      • 1970-01-01
      • 2021-01-13
      • 1970-01-01
      • 2018-06-03
      • 2022-06-13
      • 1970-01-01
      相关资源
      最近更新 更多