My understanding is that a link agentset is roughly equivalent to an edge list. In this case, I have links (3 breeds of them, but I think that's irrelevant) that have a variable, weight, that can be anywhere from 0 to 1. I'd like to store each link agentset data in its own adjacency matrix at the end of each tick. Meaning, each link weight becomes an entry in a row and column based on the end1 and end2 turtles. I think an actual matrix (a matrix extension object) would be the best in this case, because then it's easy to manipulate for outputting to behaviorspace or whatever.
Is there an elegant way to do this?
The simplest way I can think of to do this relies on turtle
whonumbers (although you could use some other identifier for yourend1andend2turtles), so I'm a little wary of it. If you are comfortable in python or R you may be better off simply reporting a nested list (something like[[ weight turtle i turtle j ] ... ]and processing after the fact- you can track turtles as row / column names in either of those or similar environments. However, here is one in-NetLogo approach that may suit your needs:setupbuilds a toy world and stores the first matrix inmatrix-list- something like:Each run of
gorandomly alters the weights of each link, but keeps the location in the matrix the same- after runninggoonce:twice:
Hopefully that gets you pointed in the right direction!