(random_state=None)
return composer.Environment(time_limit=30,
                              task=task,
                              random_state=random_state,
                              strip_singleton_obs_buffer_dim=True)
Requires a rodent to run down a corridor with gaps.
Requires a rodent to run down a corridor with gaps.
Requires a rodent to run down a corridor with gaps .
def rodent_run_gaps(random_state=None):
  """Requires a rodent to run down a corridor with gaps."""

  # Build a position-controlled rodent walker.
  walker = rodent.Rat(
      observable_options={'egocentric_camera': dict(enabled=True)})

  # Build a corridor-shaped arena with gaps, where the sizes of the gaps and
  # platforms are uniformly randomized.
  arena = corr_arenas.GapsCorridor(
      platform_length=distributions.Uniform(.4, .8),
      gap_length=distributions.Uniform(.05, .2),
      corridor_width=2,
      corridor_length=40,
      aesthetic='outdoor_natural')

  # Build a task that rewards the agent for running down the corridor at a
  # specific velocity.
  task = corr_tasks.RunThroughCorridor(
      walker=walker,
      arena=arena,
      walker_spawn_position=(5, 0, 0),
      walker_spawn_rotation=0,
      target_velocity=1.0,
      contact_termination=False,
      terminate_at_height=-0.3,
      physics_timestep=_PHYSICS_TIMESTEP,
      control_timestep=_CONTROL_TIMESTEP)

  return composer.Environment(time_limit=30,
                              task=task,
                              random_state=random_state,
                              strip_singleton_obs_buffer_dim=True)
def rodent_run_gaps ( random_state = None ) : # Build a position-controlled rodent walker. walker = rodent . Rat ( observable_options = { 'egocentric_camera' : dict ( enabled = True ) } ) # Build a corridor-shaped arena with gaps, where the sizes of the gaps and # platforms are uniformly randomized. arena = corr_arenas . GapsCorridor ( platform_length = distributions . Uniform ( .4 , .8 ) , gap_length = distributions . Uniform ( .05 , .2 ) , corridor_width = 2 , corridor_length = 40 , aesthetic = 'outdoor_natural' ) # Build a task that rewards the agent for running down the corridor at a # specific velocity. task = corr_tasks . RunThroughCorridor ( walker = walker , arena = arena , walker_spawn_position = ( 5 , 0 , 0 ) , walker_spawn_rotation = 0 , target_velocity = 1.0 , contact_termination = False , terminate_at_height = - 0.3 , physics_timestep = _PHYSICS_TIMESTEP , control_timestep = _CONTROL_TIMESTEP ) return composer . Environment ( time_limit = 30 , task = task , random_state = random_state , strip_singleton_obs_buffer_dim = True )