2017-04-05 86 views
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有礼貌的,谢谢。

回答

1

道歉,这是我的问题,我应该继续前进。我一直在争取这个几个小时,但答案只是创建链接到“其他”乌龟在邻里2