Skip to content

Question about the logic of handling agent death #112

@liuhuan0204

Description

@liuhuan0204

When an agent dies, the following code in class conversions.py will be called to clean up them
while self.aec_env.agents and ( self.aec_env.terminations[self.aec_env.agent_selection] or self.aec_env.truncations[self.aec_env.agent_selection] ): self.aec_env.step(None)
Since this is the processing after the end of a round, self.aec_env.agent_selection will point to the first agent. If the first agent is not dead, the cleanup of the dead agents will not be triggered. And the dead agent will be retained until the next round of iteration.

Is this a bug in MPE?
I tried to traverse all agents to clean up the dead individuals, but it caused an error because agent_selection did not match.

THKs

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