Closed colinhanrahan closed 4 months ago
Go ahead and add the configuration option for this one. Let's call it agentTagPreferences
where it's a Boolean value. True indicates to use tag-based (tribe-based) preferences for resources. False indicates no tag-based preferences are used.
If I'm reading the code correctly, this should be reflected in line 1034 in findWelfare
and as a new attribute for the agent.
@nkremerh It doesn't really fit in with the code we have for randomizeAgentEndowments
— there's no precedent for Boolean variables per agent. It will be the same for every agent and never change during the course of the simulation, so maybe it's closer to a Sugarscape
variable like self.configuration["screenshots"]
or self.configuration["headlessMode"]
than an Agent
one? We can still name it agentTagPreferences
, but it just won't be part of each agent's config.
Edit: neighborhood mode, movement mode, and vision mode are basically Booleans. I'll just try it as an Agent
attribute and see what it looks like.
I added the new option to the "true default" config in sugarscape.py
. This means it should be automatically set to false for all of the examples, which is what we want. However, this does bring up the issue that the formatting of example configs will go out-of-date every time we add a config option. I think we should only include the options we are changing from the default in the example configs and allow sugarscape.py
to handle the rest of them. This would keep the configs cleaner and more up-to-date. I'll add it to our Kanban backlog as a potential change.
Correct, the tag preferences will work just like movement mode, etc.
Yes, ideally each example will only include options which deviate from the default config at the bottom of sugarscape.py
.
Final change: add a description of the new config option to the README.
How does this look?
This behavior is particularly evident in
cultural_tagging.json
. I could also add the config option to this PR if we decide on that. See #64.