ray.rllib.algorithms.algorithm.Algorithm.remove_policy#

Algorithm.remove_policy(policy_id: str = 'default_policy', *, policy_mapping_fn: Callable[[Any], str] | None = None, policies_to_train: Container[str] | Callable[[str, SampleBatch | MultiAgentBatch | None], bool] | None = None, evaluation_workers: bool = True) None[source]#

Removes a new policy from this Algorithm.

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

  • 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 list of policy IDs to be trained or a callable taking PolicyID and 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.

  • evaluation_workers – Whether to also remove the policy from the evaluation WorkerSet.