nkremerh / sugarscape

Development repository for the Digital Terraria Lab implementation of the Sugarscape agent-based societal simulation.
https://github.com/digital-terraria-lab/sugarscape
MIT License
7 stars 12 forks source link

Improves findCellsInRadialRange efficiency and implements wraparound #35

Closed colinhanrahan closed 8 months ago

colinhanrahan commented 8 months ago

Should result in a massive improvement — instead of checking 50x50 = 2500 cells for the default configuration, you only need to check 1x1 = 1 up to 13x13 = 169 cells. This commit also gives findCellsInRadialRange the wraparound behavior that is already present in findCellsInCardinalRange.