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

Sets self.is_policy_to_train() to a new callable.


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