题意:OpenAI Gym CarRacing-v2 赛道终止处理
问题背景:
I am using gym==0.26.0
library and am trying to understand what means that an episode is finished/done in the CarRacing-v2 environment. In the documentation is written this.
我正在使用 `gym==0.26.0` 库,并尝试理解在 CarRacing-v2 环境中“episode finished/done”意味着什么。文档中写道:
### Rewards
The reward is -0.1 every frame and +1000/N for every track tile visited,
where N is the total number of tiles visited in the track. For example,
if you have finished in 732 frames, your reward is
1000 - 0.1*732 = 926.8 points.
### Episode Termination
The episode finishes when all of the tiles are visited. The car can also go
outside of the playfield - that is, far off the track, in which case it will receive -100 reward and die.
How many tiles does the track have? They write that the episode finishes when all of the tiles are visited but I cannnot find how many tiles does the track have. And is there a limit on how many steps can each episode have?
赛道有多少个瓷砖(tiles)?他们写道,当所有瓷砖都被访问后,回合(episode)就结束了,但我找不到赛道到底有多少个瓷砖。另外,每个回合有步数限制吗?gym/gym/envs/box2d/car_racing.py at master · openai/gym · GitHub Car Racing - Gym Documentation
问题解决:
The maximum number of steps is 1000 per episode. It seems unclear how many track tiles each episode has.
每个回合的最大步数是 1000 步。目前每个回合的赛道瓷砖数量似乎不太明确。
You can get more information calling .spec
你可以通过调用 `.spec` 获取更多信息。
gym.make("CarRacing-v2").spec
spec: EnvSpec(id='CarRacing-v2', entry_point='gymnasium.envs.box2d.car_racing:CarRacing', reward_threshold=900, nondeterministic=False, max_episode_steps=1000, order_enforce=True, autoreset=False, disable_env_checker=False, apply_api_compatibility=False, kwargs={'continuous': False, 'render_mode': None}, namespace=None, name='CarRacing', version=2)