我想建立一个道路网,以便制造出动静的乌龟。当我尝试将shapefile更改为色块并让海龟仅在色块上行走时,我发现如果海龟移到死角或卡在道路的拐角处(因为它们想去目的地)但卡在了角落)。因此,我想更改使用网络的方法。这是我想尝试编写的代码,但是它总是报告这样的错误。
扩展例外:不是VectorFeature:org.myworldgis.netlogo.VectorDataset@2de92e78 观察者运行GIS时出错:VERTEX-LISTS-OF
to load
ca
reset-ticks
set dc-dataset gis:load-dataset "Data_kk/Road_tize.shp"
gis:set-world-envelope gis:envelope-of dc-dataset
make-road-network
end
to make-road-network
clear-links
let first-node nobody
let previous-node nobody
foreach gis:feature-list-of dc-dataset [
foreach gis:vertex-lists-of dc-dataset [
foreach dc-dataset [
let location gis:location-of dc-dataset
if not empty? location [
create-nodes 1 [
set color green
set size 1
set xcor item 0 location
set ycor item 1 location
set hidden? true
if first-node = nobody [
set first-node self
]
if previous-node != nobody [
create-link-with previous-node
]
set previous-node self
]
]
]
set previous-node nobody
]
]
ask nodes [ create-links-with other nodes in-radius 0.001 ]
end
实际上,我不确切知道gis:vertex-lists-of
之后是什么样的数据,因为我是否尝试更改为另一种方法,它总是会报告这样的错误。
关于建立网络的任何建议或任何教程吗?