Skip to content

Commit

Permalink
merge master into ns_impl
Browse files Browse the repository at this point in the history
  • Loading branch information
BluemlJ committed Dec 16, 2024
2 parents b409b73 + a518d3c commit 0715cc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/rem_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pickle as pkl
import os
import atexit
from ale_py import Action


"""
Expand Down Expand Up @@ -75,6 +76,7 @@ def run(self):
self.saved_frames.append((deepcopy(self.env.get_ram()), self.env._ale.cloneState(
), self.current_frame)) # ram, state, image (rgb)
action = self._get_action()
action = self.env.get_action_meanings().index(action.name)
reward = self.env.step(action)[1]
# if reward != 0:
# print(reward)
Expand All @@ -92,14 +94,14 @@ def run(self):
i += 1
pygame.quit()

def _get_action(self):
def _get_action(self) -> Action:
pressed_keys = list(self.current_keys_down)
pressed_keys.sort()
pressed_keys = tuple(pressed_keys)
if pressed_keys in self.keys2actions.keys():
return self.keys2actions[pressed_keys]
else:
return 0 # NOOP
return Action.NOOP

def _handle_user_input(self):
self.current_mouse_pos = np.asarray(pygame.mouse.get_pos())
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import argparse

parser = argparse.ArgumentParser(
description="HackAtari run.py Argument Setter")
description="OCAtari run.py Argument Setter")

parser.add_argument(
"-g", "--game", type=str, default="Seaquest", help="Game to be run"
Expand Down

0 comments on commit 0715cc8

Please sign in to comment.