oxwhirl / smac

SMAC: The StarCraft Multi-Agent Challenge
MIT License
1.08k stars 228 forks source link

Create method to return state as dictionary #30

Closed douglasrizzo closed 4 years ago

douglasrizzo commented 4 years ago

get_state_dict() is new. It returns the global state as a dictionary. The original get_state() calls get_state_dict() and creates the vector from the dictionary, in order to avoid duplicate code.

douglasrizzo commented 4 years ago

I realized there is some redundant information being built and sent during every state transition and I found a better way to implement this method. I ask you to hold on merging it until I can send additional commits.

douglasrizzo commented 4 years ago

There. I avoid creating the list with attribute names during every state, creating it when the environment is initialized and providing it through get_env_info().

I ended up overriding get_env_info(), but kept all the information the original method provided, so that should not introduce breaking changes.

douglasrizzo commented 4 years ago

I am closing this as I have found a few obstacles in making the methods work properly, but I'll create a new PR as soon as I test everything a little more.