NetLogo passing link breed as procedure parameter -


i writing utility procedure identifies new link-neighbors of nodes in turtle-set. want able use same procedure link breed. function (not tested).

to-report all-neighbours [ nodeset edgetype ]   let nbr nobody    ask nodeset [ set nbr (turtle-set nbr edgetype-neighbors) ]   report nbr [ not member? self nodeset ] end 

this fail syntax checker because edgetype-neighbors not valid version of breed-neighbors. there way pass link breed called procedure?

i think can work around using network extension nw:set-context nodeset edgetype , nw:turtles-in-radius 1 better way , may need same general thing link procedures don't have nw versions.

get links specified breed , use [other-end] turtles:

to-report all-neighbours [ nodeset edgetype ]   let nbr nobody    ask nodeset [set nbr (turtle-set nbr [other-end] of (my-links [breed = edgetype]))]   report nbr [ not member? self nodeset ] end 

usage (if breed e.g. relations/relation):

ask all-neighbours (turtle-set turtle 0) relations [show self] 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -