Reputation: 3464
I'm trying to create links between an "active-turtle" and a group of other turtles (which are currently stored in a list).
I want to make use of the create-links-with
function, but am unable to without getting an error: expected input to be an agent-set but got a list...
This is my code ask active-turtle [create-links-with like-list]
I have a working solution, but I find it ugly so am looking for a better alternative
foreach like-list [ask ? [create-link-with active-turtle]]
Upvotes: 2
Views: 662
Reputation: 14972
The very handy turtle-set
primitive will turn your list into an agentset!
ask active-turtle [ create-links-with turtle-set like-list ]
Upvotes: 2