NetLogo: how to create-links-to an extended Moore Neighbourhood -


the following code works fine creating links moore neighborhood:

to setup clear-all   ask patches [     sprout 1   ]   ask turtles [     set size 0.5   ] end   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 

however, when try coding in similar way (see below) create links double/extended moore neighborhood, runtime error message saying "a turtle cannot link itself. error while turtle 24 running create-links-to" , error highlights line of code "create-links-to turtles-in-neighborhood2"

  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 

any suggestions hugely appreciated, thanks.

apologies, question, should have kept going. have been battling 1 few hours answer create-links-to "other" turtles-in-neighborhood2


Comments