ray.rllib.evaluation.rollout_worker.RolloutWorker.remove_policy#

RolloutWorker.remove_policy(*, policy_id: str = 'default_policy', policy_mapping_fn: Callable[[Any], str] | None = None, policies_to_train: Collection[str] | Callable[[str, SampleBatch | MultiAgentBatch | Dict[str, Any]], bool] | None = None) None[source]#

Removes a policy from this RolloutWorker.

Parameters:
  • policy_id – ID of the policy to be removed. None for DEFAULT_POLICY_ID.

  • policy_mapping_fn – An optional (updated) policy mapping function to use from here on. Note that already ongoing episodes will not change their mapping but will use the old mapping till the end of the episode.

  • policies_to_train – An optional collection of policy IDs to be trained or a callable taking PolicyID and - optionally - SampleBatchType and returning a bool (trainable or not?). If None, will keep the existing setup in place. Policies, whose IDs are not in the list (or for which the callable returns False) will not be updated.