docstr: Tests, whether freezing an AlgorithmConfig actually works as expected.
docstr_tok: ["Tests",",","whether","freezing","an","AlgorithmConfig","actually","works","as","expected","."]
code: def test_freezing_of_algo_config(self):
      """Tests, whether freezing an AlgorithmConfig actually works as expected."""
      config = (
          AlgorithmConfig()
          .environment("CartPole-v0")
          .training(lr=0.12345, train_batch_size=3000)
          .multi_agent(
              policies={
                  "pol1": (
                      None,
                      None,
                      None,
                      AlgorithmConfig.overrides(lr=0.001),
                  )
              },
              policy_mapping_fn=lambda agent_id, episode, worker, **kw: "pol1",
          )
      )
      config.freeze()
  
      def set_lr(config):
          config.lr = 0.01
  
      self.assertRaisesRegex(
          AttributeError,
          "Cannot set attribute.+of an already frozen AlgorithmConfig",
          lambda: set_lr(config),
      )
  
      # TODO: Figure out, whether we should convert all nested structures into
      #  frozen ones (set -> frozenset; dict -> frozendict; list -> tuple).
  
      def set_one_policy(config):
          config.policies["pol1"] = (None, None, None, {"lr": 0.123})
  
imports: import gymnasium
  from typing import Type
  import unittest
  import ray
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig
  from ray.rllib.algorithms.callbacks import make_multi_callbacks
  from ray.rllib.algorithms.ppo import PPO, PPOConfig
  from ray.rllib.algorithms.ppo.tf.ppo_tf_learner import PPOTfLearner
  from ray.rllib.algorithms.ppo.torch.ppo_torch_rl_module import PPOTorchRLModule
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec, RLModule
  from ray.rllib.core.rl_module.marl_module import MultiAgentRLModuleSpec, MultiAgentRLModule
  from ray.rllib.utils.test_utils import check
label_desc: Use image node_id 5 for calling the TestAlgorithmConfig obj's underlying member method code with example usage: obj.test_freezing_of_algo_config() without return types