Reputation: 3
I'm trying to monitor the length of my links in Netlogo- but I'm having a hard time getting used to the syntax. Is anyone familiar enough with it to just take the mean of all link-lengths?
Thanks.
Upvotes: 0
Views: 226
Reputation: 10291
Using this simple setup:
to setup
ca
crt 10 [
setxy random-pxcor random-pycor
]
ask turtles [
if not any? my-links [
create-link-with one-of other turtles
]
]
reset-ticks
end
You can use of
with [link-length]
to return a list of link lengths (try just typing print [link-length] of links
in the console), then use mean
to take the mean of that list. If you put that in a to-report
procedure, you will be able to display the mean-link-length
in a "monitor" widget in the "Interface":
to-report mean-link-length
report mean [link-length] of links
end
Upvotes: 1