Skip to content

Commit

Permalink
Changed state output by environments from float to boolean array
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjyoung committed Feb 14, 2020
1 parent cd40bb5 commit ef52ed0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion minatar/environments/asterix.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def difficulty_ramp(self):

# Process the game-state into the 10x10xn state provided to the agent and return
def state(self):
state = np.zeros((10,10,len(self.channels)))
state = np.zeros((10,10,len(self.channels)),dtype=bool)
state[self.player_y,self.player_x,self.channels['player']] = 1
for x in self.entities:
if(x is not None):
Expand Down
2 changes: 1 addition & 1 deletion minatar/environments/breakout.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def difficulty_ramp(self):

# Process the game-state into the 10x10xn state provided to the agent and return
def state(self):
state = np.zeros((10,10,len(self.channels)))
state = np.zeros((10,10,len(self.channels)),dtype=bool)
state[self.ball_y,self.ball_x,self.channels['ball']] = 1
state[9,self.pos, self.channels['paddle']] = 1
state[self.last_y,self.last_x,self.channels['trail']] = 1
Expand Down
2 changes: 1 addition & 1 deletion minatar/environments/freeway.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def difficulty_ramp(self):

# Process the game-state into the 10x10xn state provided to the agent and return
def state(self):
state = np.zeros((10,10,len(self.channels)))
state = np.zeros((10,10,len(self.channels)),dtype=bool)
state[self.pos,4,self.channels['chicken']] = 1
for car in self.cars:
state[car[1],car[0], self.channels['car']] = 1
Expand Down
2 changes: 1 addition & 1 deletion minatar/environments/seaquest.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def difficulty_ramp(self):

# Process the game-state into the 10x10xn state provided to the agent and return
def state(self):
state = np.zeros((10,10,len(self.channels)))
state = np.zeros((10,10,len(self.channels)),dtype=bool)
state[self.sub_y,self.sub_x,self.channels['sub_front']] = 1
back_x = self.sub_x-1 if self.sub_or else self.sub_x+1
state[self.sub_y,back_x,self.channels['sub_back']] = 1
Expand Down
2 changes: 1 addition & 1 deletion minatar/environments/space_invaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def difficulty_ramp(self):

# Process the game-state into the 10x10xn state provided to the agent and return
def state(self):
state = np.zeros((10,10,len(self.channels)))
state = np.zeros((10,10,len(self.channels)),dtype=bool)
state[9,self.pos,self.channels['cannon']] = 1
state[:,:, self.channels['alien']] = self.alien_map
if(self.alien_dir<0):
Expand Down

0 comments on commit ef52ed0

Please sign in to comment.