Skip to content

Conversation

@irgolic
Copy link

@irgolic irgolic commented Dec 1, 2025

cogames.policy.Policy => mettagrid.policy.policy.MultiAgentPolicy

@irgolic irgolic marked this pull request as draft December 1, 2025 01:08
@irgolic irgolic changed the title README: fix typo in code example import README: fix typo in code example description Dec 1, 2025
@irgolic irgolic marked this pull request as ready for review December 1, 2025 01:25
@irgolic
Copy link
Author

irgolic commented Dec 1, 2025

Looking deeper into the code example, it looks really out of date.

from mettagrid.policy.policy import MultiAgentPolicy as Policy

class MyPolicy(Policy):
    def __init__(self, observation_space, action_space):
        self.network = MyNetwork(observation_space, action_space)

The __init__ doesn't call the parent's __init__, which requires a PolicyEnvInterface argument.

self.network is a () -> None | nn.Module method in the parent, but overriden as an instance attribute in the subclass.

Beyond this example, and the scripted agents, I couldn't find any python policy examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants