microsoft / TextWorld

​TextWorld is a sandbox learning environment for the training and evaluation of reinforcement learning (RL) agents on text-based games.
Other
1.23k stars 189 forks source link

Fix loading saved kb #167

Closed MarcCote closed 5 years ago

MarcCote commented 5 years ago

Since State now takes a KnowledgeBase object as its first argument, when we reload a game we should use the KB that was saved along with it.

EDIT: This PR also avoid using TimeLimit.max_episode_seconds which was deprecated recently in OpenAI's Gym (see https://github.com/openai/gym/pull/1402).

EDIT2: This PR also avoid using trials which was removed from EnvSpec (see https://github.com/openai/gym/commit/c7bae99a06861004cf17e792e5ef88de00198e8d#diff-3dff15d44236dd4f0f823a6ddb7e8c9b).

MarcCote commented 5 years ago

It's still missing a unit test but I removed the state variable from the World class. That should be cleaner.

MarcCote commented 5 years ago

@tavianator I changed my approach about how to reload existing KB saved along with a game. Let me know what you think (second commit).

I also fixed some other deprecation in Gym (first commit).