Closed akmadian closed 6 years ago
Hi @akmadian,
I am a bit confused here:
info = env.step()
brainInfo = info[<brain_name>]
Isn't what you need all the members of the brainInfo
object derived from the above step? Which you can then serialize however you wish?
Thank you so much! I knew there must have been a better way. I'm not sure how I missed this. :/
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
After about a week of experimenting, I couldn't find out how to get data contained in the BrainInfo class when using the python API and an external brain. I'm not sure if this was because I'm missing something in the docs or because this has not been implemented yet. To solve this, I added a method to BrainInfo that packages all attributes of BrainInfo as JSON and exports it to a .txt file.
env.step() is supposed to return all of the data, but nothing was being returned when it was called.
A couple things I still need to figure out:
How well optimized this is; I haven't worked with JSON much so I'm not sure if performance can be improved, anything helps.
def exp_data(self): """ Packages BrainInfo data as JSON and exports it to a text file. This text file is located in the same directory that you're running your UnityEnvironment from. The file will be called brain_info.txt """
My forked repository can be found here
The new brain.py file can be found here
The new environment file can be found here
I have not updated the docs in my forked repository for this change yet. Any suggestions in any form are very welcome.