Skip to content

Commit

Permalink
added minimal_action_set function to each environment
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjyoung committed Mar 25, 2019
1 parent 2858af7 commit ce4706e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions environments/asterix.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ def reset(self):
# Dimensionality of the game-state (10x10xn)
def state_shape(self):
return [10,10,len(self.channels)]

def minimal_action_set(self):
minimal_actions = ['n','l','u','r','d']
return [self.action_map.index(x) for x in minimal_actions]
4 changes: 4 additions & 0 deletions environments/breakout.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,7 @@ def reset(self):
# Dimensionality of the game-state (10x10xn)
def state_shape(self):
return [10,10,len(self.channels)]

def minimal_action_set(self):
minimal_actions = ['n','l','r']
return [self.action_map.index(x) for x in minimal_actions]
4 changes: 4 additions & 0 deletions environments/freeway.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,7 @@ def reset(self):
# Dimensionality of the game-state (10x10xn)
def state_shape(self):
return [10,10,len(self.channels)]

def minimal_action_set(self):
minimal_actions = ['n','u','d']
return [self.action_map.index(x) for x in minimal_actions]
4 changes: 4 additions & 0 deletions environments/seaquest.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,7 @@ def reset(self):
# Dimensionality of the game-state (10x10xn)
def state_shape(self):
return [10,10,len(self.channels)]

def minimal_action_set(self):
minimal_actions = ['n','l','u','r','d','f']
return [self.action_map.index(x) for x in minimal_actions]
4 changes: 4 additions & 0 deletions environments/space_invaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,7 @@ def reset(self):
# Dimensionality of the game-state (10x10xn)
def state_shape(self):
return [10,10,len(self.channels)]

def minimal_action_set(self):
minimal_actions = ['n','l','r','f']
return [self.action_map.index(x) for x in minimal_actions]
3 changes: 3 additions & 0 deletions minatar_environment/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ def num_actions(self):

def game_name(self):
return self.env_name

def minimal_action_set(self):
return self.env.minimal_action_set()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from distutils.core import setup

setup(name='MinAtar',
version='1.0.1',
version='1.0.2',
description='A miniaturized version of the arcade learning environment.',
url='https://github.com/kenjyoung/MinAtar',
author='Kenny Young',
Expand Down

0 comments on commit ce4706e

Please sign in to comment.