https://github.com/ParkGyeongTae/dqn-atari-breakout/tree/main/3_frozenlake_v0
환경 설정
### Step 1) 아나콘다 가상환경 만들기
conda create -n py37 python=3.7
### Step 2) 가상환경 접속
conda activate py37
### Step 3) 라이브러리 설치
pip install gym==0.23.1
pip install pygame==2.1.2
1_frozenlake-v1-example.py
import gym
env = gym.make('FrozenLake-v1', is_slippery = False)
episode_number = 5
timestep_number = 100
for episode in range(episode_number):
observation = env.reset()
for timestep in range(timestep_number):
env.render()
action = env.action_space.sample()
observation, reward, done, info = env.step(action)
if done:
env.render()
print('Episode : {:02d} | Timestep : {:02d} | Rewards : {:02.0f}'.format(episode + 1, timestep + 1, reward))
break
env.close()
python 1_frozenlake-v1-example.py