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 11 forks source link

Fixes wraparound for cardinal range #113

Closed colinhanrahan closed 1 month ago

colinhanrahan commented 1 month ago

Radial range:

Cardinal range:

Agents can now have infinite cardinal or radial range with no issues (although it's really slow). I'm separately investigating a behavior I found with infinite range where given choice of any cell in the environment, some agents move to the very edges of peaks rather than the centers. Previously (on default settings), the radial ranges for cells went up to 49 even though no cell is farther than 35 units away from any other cell due to wraparound. This left a bunch of empty dictionaries which were never used, so I removed them.

Shortens range dictionaries to only include feasible distances--previously, radial range had empty distances