Skip to content

Ray: Support multiple policies #104

Description

@florin-pop

Hello,

The ray example was super helpful in getting things up and running, however, when I tried to configure the PPOTrainer to use one policy per agent, the wrapper provided by VMAS could not be used as is.

My configuration:

"multiagent": {
    "policies": {
        f"agent_{i}": (PPOTorchPolicy, None, None, {})
        for i in range(n_agents)
    },
    "policy_mapping_fn": lambda agent_id: f"agent_{agent_id}",
},

The error:

ValueError: Have multiple policies {}, but the env <vmas.simulator.environment.rllib.VectorEnvWrapper object at 0x71ec0c8dcbb0> is not a subclass of BaseEnv, MultiAgentEnv, ActorHandle, or ExternalMultiAgentEnv!

PS: I'm not 100% sure if this is a feature request or a misuse from my side, as I was trying to make each agent have its own policy and not share the policy model across the agents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions