ray.rllib.evaluation.rollout_worker.RolloutWorker.foreach_policy#
- RolloutWorker.foreach_policy(func: Callable[[Policy, str, Any | None], T], **kwargs) List[T] [source]#
Calls the given function with each (policy, policy_id) tuple.
- Parameters:
func – The function to call with each (policy, policy ID) tuple.
- Keyword Arguments:
kwargs – Additional kwargs to be passed to the call.
- Returns:
- The list of return values of all calls to
func([policy, pid, **kwargs])
.