I’m using agents.jl to create an ABM. Looking at the help for GridSpace I should be able to search different distances for each of the dimensions in my GridSpace
(assuming metric = :chebyshev
) with functions nearby_ids()
and nearby_positions()
. For example, in the wolf-sheep-grass example model I should be able to get all the positions within distance 1 of a given agent in the first dimension and distance 2 in the second dimension with the following:
sheepwolfgrass = initialize_model()
nearby_positions(sheepwolfgrass[1], sheepwolfgrass, (1, 2))
But the above returns the error ERROR: MethodError: no method matching bound_range(::UnitRange{Int64}, ::Int64, ::GridSpace{2, true})
If I just want to search the same distance in all dimensions it works fine, e.g.:
nearby_positions(sheepwolfgrass[1], sheepwolfgrass, 2)
I’ve obviously got something wrong, any tips as to how I can search a GridSpace
using different distances across dimensions?