nw:mean-weighted-path-length
nw:mean-weighted-path-length weight-variable
Like nw:mean-path-length
, but takes into account link weights.
Example:
links-own [ weight ]
to go
clear-all
create-turtles 3
ask turtle 0 [ create-link-with turtle 1 [ set weight 2.0 ] ]
ask turtle 1 [ create-link-with turtle 2 [ set weight 2.0 ] ]
show nw:mean-path-length
show nw:mean-weighted-path-length weight
create-turtles 1 ; create a new, disconnected turtle
show nw:mean-path-length
show nw:mean-weighted-path-length weight
end
Will ouput:
observer: 2.6666666666666665
observer: false
Take me to the full Networks Extension Dictionary