ray.rllib.core.rl_module.marl_module.MultiAgentRLModuleSpec.build#

MultiAgentRLModuleSpec.build(module_id: str | None = None) RLModule[source]#

Builds either the multi-agent module or the single-agent module.

If module_id is None, it builds the multi-agent module. Otherwise, it builds the single-agent module with the given module_id.

Note: If when build is called the module_specs is not a dictionary, it will raise an error, since it should have been updated by the caller to inform us about the module_ids.

Parameters:

module_id – The module_id of the single-agent module to build. If None, it builds the multi-agent module.

Returns:

The built module. If module_id is None, it returns the multi-agent module.