(self, random_state)
Regenerates this corridor.

    New values are drawn from the `corridor_width` and `corridor_height`
    distributions specified in `_build`. The corridor resized accordingly, and
    new sets of obstructing walls are created according to values drawn from the
    `wall_gap`, `wall_width`, `wall_height`, and `wall_rgba` distributions
    specified in `_build`.

    Args:
      random_state: A `numpy.random.RandomState` object that is passed to the
        `Variation` objects.
Regenerates this corridor.
Regenerates this corridor .
def regenerate(self, random_state):
    """Regenerates this corridor.

    New values are drawn from the `corridor_width` and `corridor_height`
    distributions specified in `_build`. The corridor resized accordingly, and
    new sets of obstructing walls are created according to values drawn from the
    `wall_gap`, `wall_width`, `wall_height`, and `wall_rgba` distributions
    specified in `_build`.

    Args:
      random_state: A `numpy.random.RandomState` object that is passed to the
        `Variation` objects.
    """
    super().regenerate(random_state)

    wall_x = variation.evaluate(
        self._wall_gap, random_state=random_state) - _CORRIDOR_X_PADDING
    if self._include_initial_padding:
      wall_x += 2*_CORRIDOR_X_PADDING
    wall_side = 0
    wall_id = 0
    while wall_x < self._current_corridor_length:
      wall_width = variation.evaluate(
          self._wall_width, random_state=random_state)
      wall_height = variation.evaluate(
          self._wall_height, random_state=random_state)
      wall_rgba = variation.evaluate(self._wall_rgba, random_state=random_state)
      if variation.evaluate(self._swap_wall_side, random_state=random_state):
        wall_side = 1 - wall_side

      wall_pos = [
          wall_x,
          (2 * wall_side - 1) * (self._current_corridor_width - wall_width) / 2,
          wall_height / 2
      ]
      wall_size = [_WALL_THICKNESS / 2, wall_width / 2, wall_height / 2]
      self._walls_body.add(
          'geom',
          type='box',
          name='wall_{}'.format(wall_id),
          pos=wall_pos,
          size=wall_size,
          rgba=wall_rgba)

      wall_id += 1
      wall_x += variation.evaluate(self._wall_gap, random_state=random_state)
def regenerate ( self , random_state ) : super ( ) . regenerate ( random_state ) wall_x = variation . evaluate ( self . _wall_gap , random_state = random_state ) - _CORRIDOR_X_PADDING if self . _include_initial_padding : wall_x += 2 * _CORRIDOR_X_PADDING wall_side = 0 wall_id = 0 while wall_x < self . _current_corridor_length : wall_width = variation . evaluate ( self . _wall_width , random_state = random_state ) wall_height = variation . evaluate ( self . _wall_height , random_state = random_state ) wall_rgba = variation . evaluate ( self . _wall_rgba , random_state = random_state ) if variation . evaluate ( self . _swap_wall_side , random_state = random_state ) : wall_side = 1 - wall_side wall_pos = [ wall_x , ( 2 * wall_side - 1 ) * ( self . _current_corridor_width - wall_width ) / 2 , wall_height / 2 ] wall_size = [ _WALL_THICKNESS / 2 , wall_width / 2 , wall_height / 2 ] self . _walls_body . add ( 'geom' , type = 'box' , name = 'wall_{}' . format ( wall_id ) , pos = wall_pos , size = wall_size , rgba = wall_rgba ) wall_id += 1 wall_x += variation . evaluate ( self . _wall_gap , random_state = random_state )