ray.rllib.core.rl_module.validate_module_id#

ray.rllib.core.rl_module.validate_module_id(policy_id: str, error: bool = False) None[source]#

Makes sure the given policy_id is valid.

Parameters:
  • policy_id – The Policy ID to check. IMPORTANT: Must not contain characters that are also not allowed in Unix/Win filesystems, such as: <>:"/|?* or a dot . or space ` ` at the end of the ID.

  • error – Whether to raise an error (ValueError) or a warning in case of an invalid policy_id.

Raises:

ValueError – If the given policy_id is not a valid one and error is True.

PublicAPI (alpha): This API is in alpha and may change before becoming stable.