ray.rllib.evaluation.rollout_worker.RolloutWorker.for_policy#

RolloutWorker.for_policy(func: Callable[[Policy, Any | None], T], policy_id: str | None = 'default_policy', **kwargs) T[source]#

Calls the given function with the specified policy as first arg.

Parameters:
  • func – The function to call with the policy as first arg.

  • policy_id – The PolicyID of the policy to call the function with.

Keyword Arguments:

kwargs – Additional kwargs to be passed to the call.

Returns:

The return value of the function call.