from ple import PLE
from ple.games.pong import Pong
game = Pong()
p = PLE(game, fps=30, display_screen=True, force_fps=False)
p.init()
myAgent = MyAgent(p.getActionSet())
nb_frames = 1000
reward = 0.0
for f in range(nb_frames):
if p.game_over(): #check if the game is over
p.reset_game()
obs = p.getScreenRGB()
action = myAgent.pickAction(reward, obs)
reward = p.act(action)
This is my test code.But it did not succeed.The error is:
NameError: name 'MyAgent' is not defined
I did not find MyAgent class in PLE or Pong ,anywhere.So,how can I run the code?
This is my test code.But it did not succeed.The error is:
Thanks for all kind humans!