ray.rllib.env.env_runner_group.EnvRunnerGroup.sync_env_runner_states#

EnvRunnerGroup.sync_env_runner_states(*, config: AlgorithmConfig, from_worker: EnvRunner | None = None, env_steps_sampled: int | None = None, connector_states: List[Dict[str, Any]] | None = None, rl_module_state: Dict[str, Any] | None = None, env_runner_indices_to_update: List[int] | None = None) None[source]#

Synchronizes the connectors of this EnvRunnerGroup’s EnvRunners.

The exact procedure works as follows: - If from_worker is None, set from_worker=self.local_worker(). - If config.use_worker_filter_stats is True, gather all remote EnvRunners’ ConnectorV2 states. Otherwise, only use the ConnectorV2 states of from_worker. - Merge all gathered states into one resulting state. - Broadcast the resulting state back to all remote EnvRunners AND the local EnvRunner.

Parameters:
  • config – The AlgorithmConfig object to use to determine, in which direction(s) we need to synch and what the timeouts are.

  • from_worker – The EnvRunner from which to synch. If None, will use the local worker of this EnvRunnerGroup.

  • env_steps_sampled – The total number of env steps taken thus far by all workers combined. Used to broadcast this number to all remote workers if update_worker_filter_stats is True in config.

  • env_runner_indices_to_update – The indices of those EnvRunners to update with the merged state. Use None (default) to update all remote EnvRunners.

DeveloperAPI: This API may change across minor Ray releases.