class_docstr: Set of EnvRunners with n @ray.remote workers and zero or one local worker.
  
  Where: n >= 0.
class_docstr_tok: ["Set","of","EnvRunners","with","n","@","ray.remote","workers","and","zero","or","one","local","worker",".","Where",":","n",">","=","0","."]
docstr: Creates and adds a number of remote workers to this worker set.
  
  Can be called several times on the same WorkerSet to add more
  EnvRunners to the set.
  
  Args:
      num_workers: The number of remote Workers to add to this
          WorkerSet.
      validate: Whether to validate remote workers after their construction
          process.
  
  Raises:
      RayError: If any of the constructed remote workers is not up and running
      properly.
docstr_tok: ["Creates","and","adds","a","number","of","remote","workers","to","this","worker","set",".","Can","be","called","several","times","on","the","same","WorkerSet","to","add","more","EnvRunners","to","the","set",".","Args",":","num_workers",":","The","number","of","remote","Workers","to","add","to","this","WorkerSet",".","validate",":","Whether","to","validate","remote","workers","after","their","construction","process",".","Raises",":","RayError",":","If","any","of","the","constructed","remote","workers","is","not","up","and","running","properly","."]
code: def add_workers(
      self, num_workers: int, validate: bool = False
  ) -> None:
      """Creates and adds a number of remote workers to this worker set.
  
      Can be called several times on the same WorkerSet to add more
      EnvRunners to the set.
  
      Args:
          num_workers: The number of remote Workers to add to this
              WorkerSet.
          validate: Whether to validate remote workers after their construction
              process.
  
      Raises:
          RayError: If any of the constructed remote workers is not up and running
          properly.
      """
      old_num_workers = self.__worker_manager.num_actors()
      new_workers = [
          self._make_worker(
              cls=self._cls,
              env_creator=self._env_creator,
              validate_env=None,
              worker_index=old_num_workers + i + 1,
              num_workers=old_num_workers + num_workers,
              config=self._remote_config,
          )
          for i in range(num_workers)
      ]
      self.__worker_manager.add_actors(new_workers)
  
      # Validate here, whether all remote workers have been constructed properly
      # and are "up and running". Establish initial states.
      if validate:
          for result in self.__worker_manager.foreach_actor(
              lambda w: w.assert_healthy()
          ):
              # Simiply raise the error, which will get handled by the try-except
              # clause around the _setup().
              if not result.ok:
                  raise result.get()
  
imports: import functools
  import gymnasium
  import logging
  import importlib.util
  import os
  from typing import Callable, Container, Dict, List, Optional, Tuple, Type, TYPE_CHECKING, TypeVar, Union
  import ray
  from ray.actor import ActorHandle
  from ray.exceptions import RayActorError
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec
  from ray.rllib.evaluation.rollout_worker import RolloutWorker
  from ray.rllib.utils.actor_manager import RemoteCallResults
  from ray.rllib.env.base_env import BaseEnv
  from ray.rllib.env.env_context import EnvContext
  from ray.rllib.env.env_runner import EnvRunner
  from ray.rllib.offline import get_dataset_and_shards
  from ray.rllib.policy.policy import Policy, PolicyState
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
  from ray.rllib.utils.actor_manager import FaultTolerantActorManager
  from ray.rllib.utils.annotations import DeveloperAPI
  from ray.rllib.utils.deprecation import Deprecated, deprecation_warning, DEPRECATED_VALUE
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.policy import validate_policy_id
  from ray.rllib.utils.typing import AgentID, EnvCreator, EnvType, EpisodeID, PartialAlgorithmConfigDict, PolicyID, SampleBatchType, TensorType
label_desc: Use image node_id 13 for calling the WorkerSet obj's underlying member method code with example usage: obj.add_workers(num_workers, validate) without return types