class_docstr: Distributed MCTS agent.
code: def __init__(
      self,
      environment_factory: Callable[[], dm_env.Environment],
      network_factory: Callable[[specs.DiscreteArray], snt.Module],
      model_factory: Callable[[specs.EnvironmentSpec], models.Model],
      num_actors: int,
      num_simulations: int = 50,
      batch_size: int = 256,
      prefetch_size: int = 4,
      target_update_period: int = 100,
      samples_per_insert: float = 32.0,
      min_replay_size: int = 1000,
      max_replay_size: int = 1000000,
      importance_sampling_exponent: float = 0.2,
      priority_exponent: float = 0.6,
      n_step: int = 5,
      learning_rate: float = 1e-3,
      discount: float = 0.99,
      environment_spec: Optional[specs.EnvironmentSpec] = None,
      save_logs: bool = False,
      variable_update_period: int = 1000,
  ):
      if environment_spec is None:
          environment_spec = specs.make_environment_spec(
              environment_factory()
          )
  
      # These 'factories' create the relevant components on the workers.
      self._environment_factory = environment_factory
      self._network_factory = network_factory
      self._model_factory = model_factory
  
      # Internalize hyperparameters.
      self._num_actors = num_actors
      self._num_simulations = num_simulations
      self._env_spec = environment_spec
      self._batch_size = batch_size
      self._prefetch_size = prefetch_size
      self._target_update_period = target_update_period
      self._samples_per_insert = samples_per_insert
      self._min_replay_size = min_replay_size
      self._max_replay_size = max_replay_size
      self._importance_sampling_exponent = importance_sampling_exponent
      self._priority_exponent = priority_exponent
      self._n_step = n_step
      self._learning_rate = learning_rate
      self._discount = discount
      self._save_logs = save_logs
      self._variable_update_period = variable_update_period
  
imports: from typing import Callable, Optional
  import acme
  from acme import datasets
  from acme import specs
  from acme.adders import reverb
  from acme.agents.tf.mcts import acting
  from acme.agents.tf.mcts import learning
  from acme.agents.tf.mcts import models
  from acme.tf import utils
  from acme.tf import variable_utils
  from acme.utils import counting
  from acme.utils import loggers
  import dm_env
  import launchpad
  import reverb
  import sonnet
label_desc: Use image node_id 1 to create a new DistributedMCTS object  with example: obj = DistributedMCTS(environment_factory, network_factory, model_factory, num_actors, num_simulations, batch_size, prefetch_size, target_update_period, samples_per_insert, min_replay_size, max_replay_size, importance_sampling_exponent, priority_exponent, n_step, learning_rate, discount, environment_spec, save_logs, variable_update_period)