@mattsap's suggestion of using the table
extension is probably the way to go, but just for the record: you might also consider using links.
The problem, in this case, is that a link can only be between a turtle and a turtle, never between turtle and a patch.
You could, however, consider making your "lands" turtles, and just put one on each patch. Here is a full example of what I mean:
breed [ lands land ]
breed [ developers developer ]
undirected-link-breed [ price-links price-link ]
price-links-own [ price ]
to setup
clear-all
set-default-shape lands "square"
create-developers 10
ask patches [
sprout-lands 1 [
set color green - 3
create-price-links-with n-of 2 developers [
hide-link
set price random 100
]
]
]
end
Depending on what you're trying to do, there might be some trade offs involved (memory being one) but conceptually, this is a very clean way to proceed.
And NetLogo makes it very easy and pleasant to work with links (much more pleasant than using the table
extension in my opinion). The main advantage is that you can query links from both directions:
observer> ask one-of developers [ show [ price ] of my-price-links ]
(developer 6): [85 68 79 26 40 60 72 85 94 50 63 75 81 97 15 46 71 34 75 15 87 0 30 9 57 23 14 63 73 66 5 13 94 20 78 8 36 12 18 49 43 35 24 38 93 34 15 72 63 68 15 86 46 21 30 67 19 89 73 62 83 33 14 13 62 46 54 17 12 35 58 7 29 51 35 99 95 96 78 74 81 36 98 45 86 2 3 45 24 35 35 43 11 63 72 11 50 16 14 60 36 89 83 50 64 65 11 38 92 75 78 94 76 12 77 30 6 61 79 63 39 68 20 99 43 72 74 1 12 18 70 98 23 72 2 15 11 44 29 17 24 73 74 53 42 63 23 53 86 45 6 60 17 49 98 79 69 96 54 6 19 20 99 46 1 31 66 85 22 42 74 2 19 60 93 54 37 20 77 75 64 42 78 40 82 11 91 13 56 56 28 34 42 5 75 7 46 91 69 83 76 92 69 71 14 35 30 85 78 95 25 3 2 1 77 73 92 31 54 83 5 89 2 32 19 10 59 72 80 93 60 62 44 92 49 49]
observer> ask one-of lands [ show [ price ] of my-price-links ]
(land 997): [43 70]
Or you can get to the developers directly from the land (and vice versa):
observer> ask one-of lands [ show sort price-link-neighbors ]
(land 112): [(developer 4) (developer 5)]
To show the price of a specific developer for a specific land:
observer> ask developer 2 [ show [ price ] of price-link-with land 737 ]
(developer 2): 94
See the Links section of the NetLogo dictionnary for all the neat things that you can do...