I'm creating clusters of agents using the nw extension weak-component-clusters. It produces a list of agentsets.
My first goal is to calculate the average xcor and ycor of each of those agentsets in the list.
I can use map to count
the number of agents in each agentset, but I can't map mean [xcor]
Example:
clear-all
create-turtles 5
ask turtle 0 [ create-link-with turtle 1 ]
ask turtle 0 [ create-link-with turtle 2 ]
ask turtle 3 [ create-link-with turtle 4 ]
let clusters nw:weak-component-clusters ; create list of agentsets
; output: [(agentset, 2 turtles) (agentset, 3 turtles)]
map count clusters ; Works
;output: [2 3]
map mean [xcor] clusters ; Does not work
;output: Expected a literal value
Secondary question: I will be calculating the distance between the clusters next and I was wondering if there was an extension or function that I could use instead of just using the distance between two points formula.