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) 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.

DeveloperAPI: This API may change across minor Ray releases.