Collaboration by the tigers
The second experiment that I implemented was designed to make the tigers' lives more complicated and encourage collaboration between them. The training and play code are the same; the only difference is in the MAgent environment's configuration. I took the double_attack
configuration file from MAgent (https://github.com/geek-ai/MAgent/blob/master/python/magent/builtin/config/double_attack.py) and tweaked it to add the reward of 0.1 after every step for both tigers and deer. The following is the modified function config_double_attack()
from Chapter25/lib/data.py
:
def config_double_attack(map_size):
gw = magent.gridworld
cfg = gw.Config()
cfg.set({"map_width": map_size, "map_height": map_size})
cfg.set({"embedding_size": 10})
We create the configuration object and set the map dimensions. The embedding size is the dimensionality of the minimap, which is not enabled in this configuration...