Skip to content

Commit

Permalink
fix: Reverse dict key and value for agents_by_type (#1996)
Browse files Browse the repository at this point in the history
* fix: Reverse dict key and value for agents_by_type

* Apply ruff --fix .

* benchmark: Ignore Ruff import recommendation
  • Loading branch information
rht authored and EwoutH committed Jan 26, 2024
1 parent 400cd88 commit 714f7bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesa/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def agents_by_type(self):

agentsbytype = defaultdict(dict)
for k, v in self._agents_by_type.items():
agentsbytype[k] = {agent: agent.unique_id for agent in v}
agentsbytype[k] = {agent.unique_id: agent for agent in v}

return agentsbytype

Expand Down

0 comments on commit 714f7bd

Please sign in to comment.