(self,
               min_size,
               max_size,
               randomizer=None,
               keep_aspect_ratio=False,
               goal_size=None,
               field_box=False,
               field_box_offset=0.0,
               top_camera_distance=_TOP_CAMERA_DISTANCE,
               name='randomized_pitch')
Construct a randomized pitch.

    Args:
      min_size: a tuple of minimum (length, width) of the pitch.
      max_size: a tuple of maximum (length, width) of the pitch.
      randomizer: a callable that returns ratio between [0., 1.] that scales
        between min_size, max_size.
      keep_aspect_ratio: if `True`, keep the aspect ratio constant during
        randomization.
      goal_size: optional (depth, width, height) indicating the goal size.
        If not specified, the goal size is inferred from pitch size with a fixed
        default ratio.
      field_box: optional indicating if we should construct field box containing
        the ball (but not the walkers).
      field_box_offset: offset for the fieldbox if used.
      top_camera_distance: the distance of the top-down camera to the pitch.
      name: the name of this arena.
Construct a randomized pitch.
Construct a randomized pitch .
def __init__(self,
               min_size,
               max_size,
               randomizer=None,
               keep_aspect_ratio=False,
               goal_size=None,
               field_box=False,
               field_box_offset=0.0,
               top_camera_distance=_TOP_CAMERA_DISTANCE,
               name='randomized_pitch'):
    """Construct a randomized pitch.

    Args:
      min_size: a tuple of minimum (length, width) of the pitch.
      max_size: a tuple of maximum (length, width) of the pitch.
      randomizer: a callable that returns ratio between [0., 1.] that scales
        between min_size, max_size.
      keep_aspect_ratio: if `True`, keep the aspect ratio constant during
        randomization.
      goal_size: optional (depth, width, height) indicating the goal size.
        If not specified, the goal size is inferred from pitch size with a fixed
        default ratio.
      field_box: optional indicating if we should construct field box containing
        the ball (but not the walkers).
      field_box_offset: offset for the fieldbox if used.
      top_camera_distance: the distance of the top-down camera to the pitch.
      name: the name of this arena.
    """
    super().__init__(
        size=max_size,
        goal_size=goal_size,
        top_camera_distance=top_camera_distance,
        field_box=field_box,
        field_box_offset=field_box_offset,
        name=name)

    self._min_size = min_size
    self._max_size = max_size

    self._randomizer = randomizer or distributions.Uniform()
    self._keep_aspect_ratio = keep_aspect_ratio

    # Sample a new size and regenerate the soccer pitch.
    logging.info('%s between (%s, %s) with %s', self.__class__.__name__,
                 min_size, max_size, self._randomizer)
def __init__ ( self , min_size , max_size , randomizer = None , keep_aspect_ratio = False , goal_size = None , field_box = False , field_box_offset = 0.0 , top_camera_distance = _TOP_CAMERA_DISTANCE , name = 'randomized_pitch' ) : super ( ) . __init__ ( size = max_size , goal_size = goal_size , top_camera_distance = top_camera_distance , field_box = field_box , field_box_offset = field_box_offset , name = name ) self . _min_size = min_size self . _max_size = max_size self . _randomizer = randomizer or distributions . Uniform ( ) self . _keep_aspect_ratio = keep_aspect_ratio # Sample a new size and regenerate the soccer pitch. logging . info ( '%s between (%s, %s) with %s' , self . __class__ . __name__ , min_size , max_size , self . _randomizer )