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

Adds agent decision model tribal factor #89

Closed colinhanrahan closed 2 months ago

colinhanrahan commented 2 months ago

agentDecisionModelTribalFactor is currently a paired endowment (with other decision model-related traits), but it could be a regular endowment instead.

0 will make agents disregard their own tribe and 1 will make them disregard other tribes, like selfishnessFactor.

nkremerh commented 2 months ago

@amuller26 Review, please.

amuller26 commented 2 months ago

In sugarscape.py at line 975, I think it needs to be

if configuration["agentDecisionModelTribalFactor"][1] > 1:
    configuration["agentDecisionModelTribalFactor"][1] = 1
elif configuration["agentDecisionModelTribalFactor"][0] < 0:
    configuration["agentDecisionModelTribalFactor"][0] = -1

It was throwing TypeError originally.

colinhanrahan commented 2 months ago

In sugarscape.py at line 975, I think it needs to be

if configuration["agentDecisionModelTribalFactor"][1] > 1:
    configuration["agentDecisionModelTribalFactor"][1] = 1
elif configuration["agentDecisionModelTribalFactor"][0] < 0:
    configuration["agentDecisionModelTribalFactor"][0] = -1

It was throwing TypeError originally.

Good catch, thanks! I also added a sort().