(self, random_state=np.random.RandomState())
Generates a new maze layout.
Generates a new maze layout.
Generates a new maze layout .
def regenerate(self, random_state=np.random.RandomState()):
    """Generates a new maze layout."""
    del random_state
    self._maze.regenerate()
    logging.debug('GENERATED MAZE:\n%s', self._maze.entity_layer)
    self._find_spawn_and_target_positions()

    if self._text_maze_regenerated_hook:
      self._text_maze_regenerated_hook()

    # Remove old texturing planes.
    for geom_name in self._texturing_geom_names:
      del self._mjcf_root.worldbody.geom[geom_name]
    self._texturing_geom_names = []

    # Remove old texturing materials.
    for material_name in self._texturing_material_names:
      del self._mjcf_root.asset.material[material_name]
    self._texturing_material_names = []

    # Remove old actual-wall geoms.
    self._maze_body.geom.clear()

    self._current_wall_texture = {
        wall_char: np.random.choice(wall_textures)
        for wall_char, wall_textures in self._wall_textures.items()
    }

    for wall_char in self._wall_textures:
      self._make_wall_geoms(wall_char)
    self._make_floor_variations()
def regenerate ( self , random_state = np . random . RandomState ( ) ) : del random_state self . _maze . regenerate ( ) logging . debug ( 'GENERATED MAZE:\n%s' , self . _maze . entity_layer ) self . _find_spawn_and_target_positions ( ) if self . _text_maze_regenerated_hook : self . _text_maze_regenerated_hook ( ) # Remove old texturing planes. for geom_name in self . _texturing_geom_names : del self . _mjcf_root . worldbody . geom [ geom_name ] self . _texturing_geom_names = [ ] # Remove old texturing materials. for material_name in self . _texturing_material_names : del self . _mjcf_root . asset . material [ material_name ] self . _texturing_material_names = [ ] # Remove old actual-wall geoms. self . _maze_body . geom . clear ( ) self . _current_wall_texture = { wall_char : np . random . choice ( wall_textures ) for wall_char , wall_textures in self . _wall_textures . items ( ) } for wall_char in self . _wall_textures : self . _make_wall_geoms ( wall_char ) self . _make_floor_variations ( )