ray.rllib.env.env_runner_group.EnvRunnerGroup.foreach_policy#
- EnvRunnerGroup.foreach_policy(func: Callable[[Policy, str], T]) List[T] [source]#
Calls
func
with each worker’s (policy, PolicyID) tuple.Note that in the multi-agent case, each worker may have more than one policy.
- Parameters:
func – A function - taking a Policy and its ID - that is called on all workers’ Policies.
- Returns:
- The list of return values of func over all workers’ policies. The
length of this list is: (num_workers + 1 (local-worker)) * [num policies in the multi-agent config dict]. The local workers’ results are first, followed by all remote workers’ results
DeveloperAPI: This API may change across minor Ray releases.