[rllib] Refactor to support passing custom env_creator function (#1096)

* refactor to use env creator

* doc

* lint
This commit is contained in:
Eric Liang
2017-10-10 12:49:42 -07:00
committed by Philipp Moritz
parent 1837824881
commit b1660c4edf
9 changed files with 109 additions and 86 deletions
+11
View File
@@ -94,6 +94,17 @@ Here is an example how to use it:
print("result: {}".format(result))
print("checkpoint saved at path: {}".format(alg.save()))
Custom Environments
~~~~~~~~~~~~~~~~~~~
To train against a custom environment, i.e. one not in the gym catalog, you
can pass a function that returns an env instead of an env id. For example:
::
env_creator = lambda: create_my_env()
alg = ppo.PPOAgent(env_creator, config)
The Developer API
-----------------