Skip to content

Commit

Permalink
Error if delete of agent fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Sep 6, 2024
1 parent 932d75f commit 3be05e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/spaces/continuous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function remove_agent_from_space!(
)
prev = abmspace(model).grid.stored_ids[cell_index...]
ai = findfirst(i -> i == a.id, prev)
isnothing(ai) && error(lazy"Tried to remove $(a) from the space, but that agent is not on the space")
deleteat!(prev, ai)
return a
end
Expand Down

0 comments on commit 3be05e7

Please sign in to comment.