mirror of
https://github.com/wassname/ray.git
synced 2026-07-27 11:26:41 +08:00
[rllib] Refactor to support passing custom env_creator function (#1096)
* refactor to use env creator * doc * lint
This commit is contained in:
committed by
Philipp Moritz
parent
1837824881
commit
b1660c4edf
@@ -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
|
||||
-----------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user