-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
SingleGrid position_agent very slow for large grids #1052
Copy link
Copy link
Closed
Labels
performanceRelease notes labelRelease notes label
Description
It's fine for square widths of around 20 cells, but when you 200 it slows right down.
It appears to be caused by the line agent.random.choice(sorted(self.empties)) where it sorts the empties first. I guess it does this so you can replicate the results using random seed?
If you don't care about replication however, it's unreasonably slow and can be fixed by using agent.random.choice(list(self.empties)) instead (speeding it enormously).
I'm not sure of the design decisions here, but maybe it's worth having two functions to make it clear or passing some sort of bool?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
performanceRelease notes labelRelease notes label