Skip to content

Commit

Permalink
Small fix in insert_agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
djgroen committed Sep 23, 2024
1 parent d3a9dbf commit 1569c60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions flee/flee.py
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ def addAgent(self, location, attributes) -> None:


@check_args_type
def insertAgent(self, location) -> None:
def insertAgent(self, location, attributes={}) -> None:
"""
Summary:
Inserts an agent into the simulation at the specified location.
Expand All @@ -1786,7 +1786,7 @@ def insertAgent(self, location) -> None:
Returns:
None.
"""
self.agents.append(Person(location=location, attributes={}))
self.agents.append(Person(location=location, attributes=attributes))


@check_args_type
Expand Down
4 changes: 2 additions & 2 deletions flee/pflee.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def addAgent(self, location, attributes) -> None:


@check_args_type
def insertAgent(self, location) -> None:
def insertAgent(self, location, attributes={}) -> None:
"""
Summary:
Inserts an agent into the ecosystem at the specified location.
Expand All @@ -601,7 +601,7 @@ def insertAgent(self, location) -> None:
"""
self.total_agents += 1
if self.total_agents % self.mpi.size == self.mpi.rank:
self.agents.append(Person(self, location=location))
self.agents.append(Person(self, location=location, attributes=attributes))


@check_args_type
Expand Down

0 comments on commit 1569c60

Please sign in to comment.