eugenevinitsky / sequential_social_dilemma_games

Repo for reproduction of sequential social dilemmas
MIT License
387 stars 132 forks source link

Fix hardcoding of agent char as 'P' #85

Closed eugenevinitsky closed 5 years ago

eugenevinitsky commented 5 years ago

In the code it is hardcoded that agent cells are 'P'. If at any point we choose to change this, change amplification occurs and nearly the whole codebase needs to be rewritten.

natashamjaques commented 5 years ago

Could replace with a function called something like "check_if_agent_cell", that checks if the map character is an int, and > 0 (because I'm using agent IDs 1-9 on the map). Then instead of calling the function get_map_with_agents everywhere, we can just maintain the real map with the agent IDs in it. More computationally efficient.

eugenevinitsky commented 5 years ago

This makes sense!

eugenevinitsky commented 5 years ago

Eh, this is not a huge deal and makes rewriting the tests really frustrating.