ray.rllib.evaluation.rollout_worker.RolloutWorker.for_policy
ray.rllib.evaluation.rollout_worker.RolloutWorker.for_policy#
- RolloutWorker.for_policy(func: Callable[[ray.rllib.policy.policy.Policy, Optional[Any]], ray.rllib.utils.typing.T], policy_id: Optional[str] = 'default_policy', **kwargs) ray.rllib.utils.typing.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.