Skip to content

Commit

Permalink
Docs, copy-paste error [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Panchenko committed Aug 18, 2024
1 parent 5ae36b4 commit 1eaf276
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions docs/01_tutorials/04_tictactoe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,29 +127,6 @@ Tianshou already provides some builtin classes for multi-agent learning. You can
::

>>> from tianshou.data import Collector
>>> from tianshou.env import DummyVectorEnv
>>> from tianshou.policy import RandomPolicy, MultiAgentPolicyManager
>>>
>>> # agents should be wrapped into one policy,
>>> # which is responsible for calling the acting agent correctly
>>> # here we use two random agents
>>> policy = MultiAgentPolicyManager(
>>> [MARLRandomPolicy(action_space=env.action_space), RandomPolicy(action_space=env.action_space)], env
>>> )
>>>
>>> # need to vectorize the environment for the collector
>>> env = DummyVectorEnv([lambda: env])
>>>
>>> # use collectors to collect a episode of trajectories
>>> # the reward is a vector, so we need a scalar metric to monitor the training
>>> collector = Collector(policy, env)
>>>
>>> # you will see a long trajectory showing the board status at each timestep
>>> result = collector.collect(n_episode=1, render=.1)
(only show the last 3 steps)
| |
X | X | -

>>> from tianshou.env import DummyVectorEnv
>>> from tianshou.policy import RandomPolicy, MultiAgentPolicyManager
>>>
Expand Down

0 comments on commit 1eaf276

Please sign in to comment.