Skip to content

Commit

Permalink
make new_agents optional for recreatertree
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvince committed May 27, 2020
1 parent 8f8468d commit 64d0bbb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mesa_geo/geospace.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ def get_neighbors(self, agent):
neighbors = [self.agents[i] for i in neighbors_idx]
return neighbors

def _recreate_rtree(self, new_agents):
def _recreate_rtree(self, new_agents=None):
"""Create a new rtree index from agents shapes."""

if new_agents is None:
new_agents = []
old_agents = list(self.agents)
agents = old_agents + new_agents

Expand Down

0 comments on commit 64d0bbb

Please sign in to comment.