parameters: (self, streetlearn)
return_statement: return reward
docstring: Looks at current_pano_id and collects any reward found there.
  
      Args:
        streetlearn: A streetlearn instance.
      Returns:
        reward: the reward from the last step.
docstring_summary: Looks at current_pano_id and collects any reward found there.
docstring_tokens: Looks at current_pano_id and collects any reward found there .
function: def get_reward(self, streetlearn):
      """Looks at current_pano_id and collects any reward found there.
  
      Args:
        streetlearn: A streetlearn instance.
      Returns:
        reward: the reward from the last step.
      """
      # If we have exceeded the maximum steps to look for a goal, reset the goal.
      if self._num_steps_this_goal > self._goal_timeout:
        logging.info('seed %d, frame %d: courier target TIMEOUT (%d steps)',
                     streetlearn.seed, streetlearn.frame_count,
                     self._num_steps_this_goal)
        self._num_steps_this_goal = 0
        self._pick_random_goal(streetlearn)
  
      (reward, found_goal) = self._compute_reward(streetlearn)
  
      # If we have found the goal, set a new one and update episode statistics.
      if found_goal:
        logging.info('seed %d, frame %d: courier target FOUND (%d steps)',
                     streetlearn.seed, streetlearn.frame_count,
                     self._num_steps_this_goal)
        _, num_remaining_panos_to_goal_center = self._shortest_paths(
          streetlearn, self._current_goal_id, streetlearn.current_pano_id)
        self._success_inverse_path_len.append(
            self._compute_spl_current_goal(streetlearn))
        self._pick_random_goal(streetlearn)
        self._num_steps_this_goal = 0
  
      # Give additional reward if current pano has a coin.
      if streetlearn.current_pano_id in self._coin_pano_id_set:
        reward += self._reward_per_coin
        self._coin_pano_id_set.remove(streetlearn.current_pano_id)
  
      self._num_steps_this_goal += 1
      return reward
function_tokens: def get_reward ( self , streetlearn ) : # If we have exceeded the maximum steps to look for a goal, reset the goal. if self . _num_steps_this_goal > self . _goal_timeout : logging . info ( 'seed %d, frame %d: courier target TIMEOUT (%d steps)' , streetlearn . seed , streetlearn . frame_count , self . _num_steps_this_goal ) self . _num_steps_this_goal = 0 self . _pick_random_goal ( streetlearn ) ( reward , found_goal ) = self . _compute_reward ( streetlearn ) # If we have found the goal, set a new one and update episode statistics. if found_goal : logging . info ( 'seed %d, frame %d: courier target FOUND (%d steps)' , streetlearn . seed , streetlearn . frame_count , self . _num_steps_this_goal ) _ , num_remaining_panos_to_goal_center = self . _shortest_paths ( streetlearn , self . _current_goal_id , streetlearn . current_pano_id ) self . _success_inverse_path_len . append ( self . _compute_spl_current_goal ( streetlearn ) ) self . _pick_random_goal ( streetlearn ) self . _num_steps_this_goal = 0 # Give additional reward if current pano has a coin. if streetlearn . current_pano_id in self . _coin_pano_id_set : reward += self . _reward_per_coin self . _coin_pano_id_set . remove ( streetlearn . current_pano_id ) self . _num_steps_this_goal += 1 return reward