ray.rllib.evaluation.rollout_worker.RolloutWorker.set_is_policy_to_train#

RolloutWorker.set_is_policy_to_train(is_policy_to_train: Collection[str] | Callable[[str, SampleBatch | MultiAgentBatch | Dict[str, Any] | None], bool]) None[source]#

Sets self.is_policy_to_train() to a new callable.

Parameters:

is_policy_to_train – A 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.