ray.rllib.utils.policy.create_policy_for_framework#

ray.rllib.utils.policy.create_policy_for_framework(policy_id: str, policy_class: Type[Policy], merged_config: dict, observation_space: gymnasium.Space, action_space: gymnasium.Space, worker_index: int = 0, session_creator: Callable[[], tf1.Session] | None = None, seed: int | None = None)[source]#

Framework-specific policy creation logics.

Parameters:
  • policy_id – Policy ID.

  • policy_class – Policy class type.

  • merged_config – Complete policy config.

  • observation_space – Observation space of env.

  • action_space – Action space of env.

  • worker_index – Index of worker holding this policy. Default is 0.

  • session_creator – An optional tf1.Session creation callable.

  • seed – Optional random seed.