1
下面的代码工作正常用于创建链接到一个摩尔街区:的NetLogo:如何创建链接到一个扩展摩尔定律邻居
to setup
clear-all
ask patches [
sprout 1
]
ask turtles [
set size 0.5
]
end
to go
ask patch 0 0 [
let investor turtles-here
let neighborhood patch-set neighbors
ask neighborhood [
let turtles-in-neighborhood turtles-here
ask investor [
create-links-to turtles-in-neighborhood
]
]
]
end
然而,当我尝试以类似的方式编码(见下文)创建链接到一个双/扩展Moore邻域,我得到一个运行时错误消息,说“一只乌龟不能链接到它自己,错误,而乌龟24运行CREATE-LINKS-TO”,错误突出显示了代码行“create-links -to-turtles-in-neighborhood2“
to go
ask patch 0 0 [
let investor turtles-here
let neighborhood2 patch-set [neighbors] of neighbors
ask neighborhood2 [
let turtles-in-neighborhood2 turtles-here
ask investor [
create-links-to turtles-in-neighborhood2
]
]
]
end
任何意见巨大appr有礼貌的,谢谢。