- class ray.rllib.evaluation.worker_set.WorkerSet(*, 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_workers: int = 0, local_worker: bool = True, logdir: str | None = None, _setup: bool = True)#
Set of EnvRunners with n @ray.remote workers and zero or one local worker.
Where: n >= 0.
Initializes a WorkerSet instance.
Adds a policy to this WorkerSet'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.
funcwith all workers' sub-environments as args.
funcwith all workers' sub-environments and env_ctx as args.
funcwith each worker's (policy, PolicyID) tuple.
functo all workers' Policies iff in
Calls the given function with each worker instance as the argument.
Calls the given function asynchronously with each worker as the argument.
Similar to foreach_worker(), but calls the function with id of the worker too.
Returns the list of remote worker IDs.
Whether given PolicyID (optionally inside some batch) is trainable.
Returns the local rollout worker.
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.
Total number of times managed remote workers have been restarted.
Returns the number of remote rollout workers.
Checks for unhealthy workers and tries restoring their states.
Hard overrides the remote workers in this set with the given one.
stopon all rollout workers (including the local one).
Syncs model weights from the given weight source to all remote workers.