class_docstr: Wraps env configurations to include extra rllib metadata.
  
  These attributes can be used to parameterize environments per process.
  For example, one might use `worker_index` to control which data file an
  environment reads in on initialization.
  
  RLlib auto-sets these attributes when constructing registered envs.
docstr: Initializes an EnvContext instance.
  
  Args:
      env_config: The env's configuration defined under the
          "env_config" key in the Algorithm's config.
      worker_index: When there are multiple workers created, this
          uniquely identifies the worker the env is created in.
          0 for local worker, >0 for remote workers.
      vector_index: When there are multiple envs per worker, this
          uniquely identifies the env index within the worker.
          Starts from 0.
      remote: Whether individual sub-environments (in a vectorized
          env) should be @ray.remote actors or not.
      num_workers: The total number of (remote) workers in the set.
          0 if only a local worker exists.
      recreated_worker: Whether the worker that holds this env is a recreated one.
          This means that it replaced a previous (failed) worker when
          `recreate_failed_workers=True` in the Algorithm's config.
docstr_tok: ["Initializes","an","EnvContext","instance",".","Args",":","env_config",":","The","env","'s","configuration","defined","under","the","``","env_config","''","key","in","the","Algorithm","'s","config",".","worker_index",":","When","there","are","multiple","workers","created",",","this","uniquely","identifies","the","worker","the","env","is","created","in",".","0","for","local","worker",",",">","0","for","remote","workers",".","vector_index",":","When","there","are","multiple","envs","per","worker",",","this","uniquely","identifies","the","env","index","within","the","worker",".","Starts","from","0.","remote",":","Whether","individual","sub-environments","(","in","a","vectorized","env",")","should","be","@","ray.remote","actors","or","not",".","num_workers",":","The","total","number","of","(","remote",")","workers","in","the","set",".","0","if","only","a","local","worker","exists",".","recreated_worker",":","Whether","the","worker","that","holds","this","env","is","a","recreated","one",".","This","means","that","it","replaced","a","previous","(","failed",")","worker","when","`","recreate_failed_workers=True","`","in","the","Algorithm","'s","config","."]
code: def __init__(
      self,
      env_config: EnvConfigDict,
      worker_index: int,
      vector_index: int = 0,
      remote: bool = False,
      num_workers: Optional[int] = None,
      recreated_worker: bool = False,
  ):
      """Initializes an EnvContext instance.
  
      Args:
          env_config: The env's configuration defined under the
              "env_config" key in the Algorithm's config.
          worker_index: When there are multiple workers created, this
              uniquely identifies the worker the env is created in.
              0 for local worker, >0 for remote workers.
          vector_index: When there are multiple envs per worker, this
              uniquely identifies the env index within the worker.
              Starts from 0.
          remote: Whether individual sub-environments (in a vectorized
              env) should be @ray.remote actors or not.
          num_workers: The total number of (remote) workers in the set.
              0 if only a local worker exists.
          recreated_worker: Whether the worker that holds this env is a recreated one.
              This means that it replaced a previous (failed) worker when
              `recreate_failed_workers=True` in the Algorithm's config.
      """
      # Store the env_config in the (super) dict.
      dict.__init__(self, env_config)
  
      # Set some metadata attributes.
      self.worker_index = worker_index
      self.vector_index = vector_index
      self.remote = remote
      self.num_workers = num_workers
      self.recreated_worker = recreated_worker
  
file_path: ray/python/ray/rllib/env/env_context.py
imports: import copy
  from typing import Optional
  from ray.rllib.utils.annotations import PublicAPI
  from ray.rllib.utils.typing import EnvConfigDict
label_desc: Use image node_id 1 to create a new EnvContext object from inherited base classes: dict with example: obj = EnvContext(env_config, worker_index, vector_index, remote, num_workers, recreated_worker)