oxwhirl / smac

SMAC: The StarCraft Multi-Agent Challenge
MIT License
1.04k stars 227 forks source link

Created methods that return the size of different features to the user #27

Closed douglasrizzo closed 4 years ago

douglasrizzo commented 4 years ago

While reading the code to understand what the observation vector is composed of, I found the opportunity to implement methods inside the StarCraft2Env class to expose how much of the observation is composed of agent movement features, enemy features, ally features and agent features. This may help other users interpret or separate the observation vector in its smaller components, in case they deem it necessary.

The methods I created also removed redundant code in situations where the size of the observation vector was calculated in different parts of the code (e.g. inside get_obs() and get_obs_size()).

Lastly, I took the opportunity to briefly describe in the docstring what the observation vector is composed of.

douglasrizzo commented 4 years ago

I forgot to mention I have made a few assertion tests to make sure the new methods return the same values that were provided by SMAC before my changes. I also installed my version of the package and ran the random agent with success.

samvelyan commented 4 years ago

Thanks for the contribution @douglasrizzo. I'll take a close look and merge changes.