docstr: Interacts with remote simulator.
          
docstr_tok: ["Interacts","with","remote","simulator","."]
code: def run_remote_sample(self, ident):
      """Interacts with remote simulator."""
      remote_actor = Actor(self.config)
      mem = defaultdict(list)
  
      obs = remote_actor.reset()
      while True:
          self.predict_input_queue.put((ident, obs))
          action, value = self.predict_output_queues[ident].get()
  
          next_obs, reward, done = remote_actor.step(action)
  
          mem["obs"].append(obs)
          mem["actions"].append(action)
          mem["rewards"].append(reward)
          mem["values"].append(value)
  
          if done:
              next_value = 0
              advantages = calc_gae(
                  mem["rewards"],
                  mem["values"],
                  next_value,
                  self.config["gamma"],
                  self.config["lambda"],
              )
              target_values = advantages + mem["values"]
  
              self.sample_data_queue.put(
                  {
                      "obs": mem["obs"],
                      "actions": mem["actions"],
                      "advantages": advantages,
                      "target_values": target_values,
                  }
              )
  
              mem = defaultdict(list)
  
              next_obs = remote_actor.reset()
  
          elif len(mem["obs"]) == self.config["t_max"] + 1:
              next_value = mem["values"][-1]
              advantages = calc_gae(
                  mem["rewards"][:-1],
                  mem["values"][:-1],
                  next_value,
                  self.config["gamma"],
                  self.config["lambda"],
              )
              target_values = advantages + mem["values"][:-1]
  
              self.sample_data_queue.put(
                  {
                      "obs": mem["obs"][:-1],
                      "actions": mem["actions"][:-1],
                      "advantages": advantages,
                      "target_values": target_values,
                  }
              )
  
              for key in mem:
                  mem[key] = [mem[key][-1]]
  
          obs = next_obs
  
          if done:
              metrics = remote_actor.get_metrics()
              if metrics:
                  self.remote_metrics_queue.put(metrics)
  
imports: from parl.utils import check_version_for_fluid
  import gym
  import numpy
  import os
  from six.moves import queue
  import six
  import time
  import threading
  import parl
  from atari_model import AtariModel
  from atari_agent import AtariAgent
  from collections import defaultdict
  from parl.env.atari_wrappers import wrap_deepmind
  from parl.utils import logger, get_gpu_count, summary
  from parl.utils.scheduler import PiecewiseScheduler
  from parl.utils.time_stat import TimeStat
  from parl.utils.window_stat import WindowStat
  from parl.utils.rl_utils import calc_gae
  from parl.utils import machine_info
  from actor import Actor
label_desc: Use image node_id 6 for calling the Learner obj's underlying member method code with example usage: obj.run_remote_sample(ident) without return types