Reputation: 61
I am trying to distribute resources in a way that I can specify the number of resources and make sure that they have at least one patch between them.
In this example, the resources are being distributed across a set of hex tile turtles built on the underlying patch framework and tied together by links.
set-default-shape resources "resource stone" [
ask n-of 10 tiles with [not any? resources in-radius 2] [
hatch-resources 1 [
set color brown
]]]
I cannot seem to get this to work and I think it is because the resources are not yet created in order to calculate the "not any?" bit.
Upvotes: 1
Views: 90
Reputation: 30453
I concur with "I think it is because the resources are not yet created in order to calculate the "not any?" bit". So how about:
repeat 10 [
ask one-of patches with [not any? resources in-radius 2] [
...
]
]
Upvotes: 0