ray.rllib.env.env_runner_group.EnvRunnerGroup#
- class ray.rllib.env.env_runner_group.EnvRunnerGroup(*, env_creator: Callable[[EnvContext], Any | gymnasium.Env | None] | None = None, validate_env: Callable[[Any | gymnasium.Env], None] | None = None, default_policy_class: Type[Policy] | None = None, config: AlgorithmConfig | None = None, num_env_runners: int = 0, local_env_runner: bool = True, logdir: str | None = None, _setup: bool = True, tune_trial_id: str | None = None, num_workers=-1, local_worker=-1)[source]#
Set of EnvRunners with n @ray.remote workers and zero or one local worker.
Where: n >= 0.
DeveloperAPI: This API may change across minor Ray releases.
Methods
Initializes a EnvRunnerGroup instance.
Adds a policy to this EnvRunnerGroup's workers or a specific list of workers.
Creates and adds a number of remote workers to this worker set.
Get esults from outstanding asynchronous requests that are ready.
Calls
func
with all workers' sub-environments as args.Calls
func
with all workers' sub-environments and env_ctx as args.Calls
func
with each worker's (policy, PolicyID) tuple.Apply
func
to all workers' Policies iff inpolicies_to_train
.Calls the given function with each EnvRunner as its argument.
Calls the given function asynchronously with each worker as the argument.
Calls the given function with each EnvRunner and its ID as its arguments.
Infer observation and action spaces from one (local or remote) EnvRunner.
Returns the list of remote worker IDs.
Whether given PolicyID (optionally inside some batch) is trainable.
Returns the number of healthy remote workers.
Returns the number of all healthy workers, including the local worker.
Returns the number of in-flight async requests.
Returns the number of remote EnvRunners.
Total number of times managed remote workers have been restarted.
Returns the number of remote EnvRunners.
Checks for unhealthy workers and tries restoring their states.
Hard overrides the remote EnvRunners in this set with the provided ones.
Calls
stop
on all rollout workers (including the local one).Synchronizes the connectors of this EnvRunnerGroup's EnvRunners.
Syncs model weights from the given weight source to all remote workers.
Attributes
Returns the local EnvRunner.