I have a program where each peer has their own ranking system of other peers, what is the best way to implement this is NetLogo?
Normally, I would solve this with a 2D list:
[[turtle 1, score], [turtle 2, score], ...]
But this seems very troubling in NetLogo. This is my code for creating and modifying a 2D list:
to test clear-all crt 10 ;Create a list of turtles let agents-list [self] of turtles ;Create empty list, which will be the top level of the TwoD list let TwoD-list  ;Populate the TwoD-list: [[turtle 0, 0], [turtle 1, 0], ...] foreach agents-list [ set TwoD-list (lput (list ? 0) TwoD-list) ] show TwoD-list repeat 5 [ ;Change a value in the TwoD-list let rand-index random (length TwoD-list) ;select a random index ;The next line is what makes it a huge headache, basically you have to select a list at the top level to replace, and then select the list at the lower level to replace it. ;This entire line of code is just adding one to an element set TwoD-list (replace-item rand-index TwoD-list (replace-item 1 (item rand-index TwoD-list) (item 1 (item rand-index TwoD-list) + 1))) show TwoD-list ] end
What else can I do? Or is there a better way to implement this method?