Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/devdocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ In principle, the following should be done:
5. Extend `add_agent_to_space!(agent, model), remove_agent_from_space!(agent, model)`. This already provides access to `add_agent!, kill_agent!` and `move_agent!`.
6. Extend `nearby_ids(pos, model, r)`.
7. Create a new "minimal" agent type to be used with [`@agent`](@ref) (see the source code of [`GraphAgent`](@ref) for an example).
8. If you want to enable plotting with this space out of the box, also extend [`spacesize`](@ref).

And that's it! Every function of the main API will now work. In some situations you might want to explicitly extend other functions such as `move_agent!` or `remove_all_from_space!` for performance reasons.

Expand Down
2 changes: 1 addition & 1 deletion ext/AgentsVisualizations/src/spaces/abstract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,6 @@ function Agents.agent2string(agent::A) where {A<:AbstractAgent}
return agentstring
end

Agents.convert_element_pos(::S, pos) where {S<:Agents.AbstractSpace} = Tuple(pos)
Agents.convert_element_pos(s::S, pos) where {S<:Agents.AbstractSpace} = Tuple(pos[1:length(spacesize(s))])

Agents.ids_to_inspect(model::ABM, pos) = ids_in_position(pos, model)
Loading