ray.rllib.evaluation.rollout_worker.RolloutWorker.foreach_policy_to_train#
- RolloutWorker.foreach_policy_to_train(func: Callable[[Policy, str, Any | None], T], **kwargs) List[T] [source]#
Calls the given function with each (policy, policy_id) tuple.
Only those policies/IDs will be called on, for which
self.is_policy_to_train()
returns True.- Parameters:
func – The function to call with each (policy, policy ID) tuple, for only those policies that
self.is_policy_to_train
returns True.- 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])
.