Skip to content

Error with the PettingZooWrapper? #46

Description

@eperm17

Hello everyone!

I am trying to use the PettingZooWrapper for the Scenario1b, following the tutorial explained on the "1.Introduction.ipynb" notebook.

Although the example (DroneSwarmScenarioGenerator) given in this notebook works perfectly well with the PEttingZooWrapper, when I try to do the same with the FileReaderScenarioGenerator (code below), I get an error.

from CybORG.Simulator.Scenarios import FileReaderScenarioGenerator
from CybORG import CybORG
from CybORG.Agents.Wrappers import PettingZooParallelWrapper

path = inspect.getfile(CybORG)
path = '/Simulator/Scenarios/scenario_files/Scenario1b.yaml'
sg = FileReaderScenarioGenerator(path)
cyborg = CybORG(scenario_generator=sg)

env = PettingZooParallelWrapper(cyborg)
obs = env.reset()
print(obs.keys())

The error I get:


AttributeError Traceback (most recent call last)
Cell In[4], line 3
1 from CybORG.Agents.Wrappers import PettingZooParallelWrapper
----> 3 env = PettingZooParallelWrapper(cyborg)
4 obs = env.reset()
6 print(obs.keys())

File c:\desktop\cyborg\cyborg\CybORG\Agents\Wrappers\PettingZooParallelWrapper.py:29, in PettingZooParallelWrapper.init(self, env)
27 self.msg_len = 0
28 self.metadata = {"render_modes": ["human", "rgb_array"], "name": "Cage_Challenge_3"}
---> 29 self.agent_actions = self.int_to_cyborg_action()
30 self.dones = {agent: False for agent in self.possible_agents}
31 self.rewards = {agent: 0. for agent in self.possible_agents}

AttributeError: 'PettingZooParallelWrapper' object has no attribute 'int_to_cyborg_action'


Thanks a lot in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions