JuliaDynamics/Agents.jl

Space interface: make it use the space directly, not the model

Open

#1,157 建立於 2025年4月17日

在 GitHub 查看
 (0 留言) (2 反應) (0 負責人)Julia (904 star) (146 fork)batch import
claritygood first issue

描述

For code clairity and cleanup, we should change the Space interface functions (those a user has to extend to define a new space), to use the space instance directly.

So, add_agent_to_space!(a::AbstractAgent, model::GridSpaceSingle) instead of add_agent_to_space!(a::AbstractAgent, model::ABM{<:GridSpaceSingle}). This should be done for all four Space Interface functions that are discussed int he developer docs https://juliadynamics.github.io/Agents.jl/stable/devdocs/#make_new_space . Then, functions such as move_agent! will use the abmspace function to directly pass the space to the interface functions.

This issue has no bearing on the codebase, and doesn't implement any new features, but it is a nice thing to do for clarity. It establishes clearly the orthogonality between choosing a space and choosing a model type (i.e., a time evolution rule).

I am not sure why we didn't do it in the first place.... This is a nice good first issue for someone wanting to have a good overview of the Agents.jl codebase! Very good for preparing someone to do nice contributions, such as a GSOC project!

貢獻者指南