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

Prevents inherited curses creating zombie agents #92

Closed colinhanrahan closed 2 months ago

colinhanrahan commented 2 months ago

When an agent dies from starvation, their sugar or spice can be negative. Attempting to pass on this negative wealth to children or other heirs results in the heirs losing wealth instead of gaining wealth. If heirs have already completed their timestep but this curse brings one of their resources into the negative, they will be removed from Sugarscape's self.agents by removeDeadAgents without going through the proper doDeath process. This results in zombie agents that are kept alive by their cells referencing them and eventually overwritten when a new agent enters the cell.

nkremerh commented 2 months ago

Good catch!