|
|
@ -83,21 +83,21 @@ class Playground(MiniGridEnv): |
|
|
|
assert width >= 5 and height >= 5 |
|
|
|
# Create an empty grid |
|
|
|
self.grid = Grid(width, height) |
|
|
|
|
|
|
|
|
|
|
|
slippery_north = SlipperyNorth(probability_intended=self.probability_intended, probability_turn_intended=self.probability_turn_intended) |
|
|
|
slippery_east = SlipperyEast(probability_intended=self.probability_intended, probability_turn_intended=self.probability_turn_intended) |
|
|
|
slippery_south = SlipperySouth(probability_intended=self.probability_intended, probability_turn_intended=self.probability_turn_intended) |
|
|
|
slippery_west = SlipperyWest(probability_intended=self.probability_intended, probability_turn_intended=self.probability_turn_intended) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# A rectangular wall around the environment |
|
|
|
self.grid.wall_rect(0, 0, width, height) |
|
|
|
|
|
|
|
# Change the goal position: |
|
|
|
|
|
|
|
# Change the goal position: |
|
|
|
self.put_obj(Goal(), width - 2, 1) |
|
|
|
|
|
|
|
# TODO: Add walls, pools of lava, etc. |
|
|
|
# TODO: Add walls, pools of lava, etc. |
|
|
|
self.grid.horz_wall(2, 1, 3, slippery_north) |
|
|
|
self.grid.vert_wall(5, 2, 2, slippery_east) |
|
|
|
l = 4 |
|
|
@ -120,6 +120,8 @@ class Playground(MiniGridEnv): |
|
|
|
properties_str = "" |
|
|
|
if self.faulty_behavior: |
|
|
|
properties_str += F"FaultProbability:{self.fault_probability}\n" |
|
|
|
properties_str += F"ProbTurnIntended:{self.probability_turn_intended}\n" |
|
|
|
properties_str += F"ProbForwardIntended:{self.probability_intended}\n" |
|
|
|
return grid + properties_str |
|
|
|
|
|
|
|
|