Mandatory I’m brand new to Julia and Agents.jl so apologies if this is obvious.
I am making a predator-prey model, following the wolf-sheep example.
My GridSpace has a property “grass”. In the example predator-prey model, sheep move at random to a nearby cell. I would like my sheep to “look” around and move to the nearest cell where there is grass. To do this I think I need something like nearby_agents (but for nearby grid cells) to retrieve a vector of grid cell IDs within range r (sheep vision range). I would then be able to iterate over the nearby cells to see a) which have grass and b) which is closest.
My question: Is there an equivalent of nearby_agents for nearby cells? And does my approach seem sensible?
Hah, I was about to say “I think you need nearby_positions”. But I realized, this function doesn’t exist. Which is obviously a neglect from our end, since the code exists. In fact, when you call nearby_agents, an “function” nearby_positions is called first. Please open an issue in the Agents.jl GitHub repository asking for a nearyb positions function