Skip to content

Commit

Permalink
Change to GoToRedBlueBall requested by Konrad (mila-iqia#83)
Browse files Browse the repository at this point in the history
* Added new level, GoToRedBlueBall

* Only one object in GoToRedBlueBall
  • Loading branch information
maximecb authored Oct 4, 2019
1 parent 9191ac3 commit ec65f0c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions babyai/levels/bonus_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Level_GoToRedBlueBall(RoomGridLevel):
"""
Go to the red ball or to the blue ball.
Simple level with language and exactly two different objects.
There is only one object, and therefore language is not required.
"""

def __init__(self, room_size=8, seed=None):
Expand All @@ -20,10 +20,8 @@ def __init__(self, room_size=8, seed=None):

def gen_mission(self):
self.place_agent()
red_ball, _ = self.add_object(0, 0, 'ball', 'red')
blue_ball, _ = self.add_object(0, 0, 'ball', 'blue')

obj = self._rand_elem([red_ball, blue_ball])
color = self._rand_elem(['red', 'blue'])
obj, _ = self.add_object(0, 0, 'ball', color)
self.instrs = GoToInstr(ObjDesc(obj.type, obj.color))


Expand Down

0 comments on commit ec65f0c

Please sign in to comment.