cage-challenge / cage-challenge-4

The TTCP CAGE Challenges are a series of public challenges instigated to foster the development of autonomous cyber defensive agents. This CAGE Challenge 4 (CC4) returns to a defence industry enterprise environment, and introduces a Multi-Agent Reinforcement Learning (MARL) scenario.
https://cage-challenge.github.io/cage-challenge-4/
Other
41 stars 10 forks source link

RandomAgent action space gym import #25

Closed rliu100 closed 7 months ago

rliu100 commented 8 months ago

Should the import at the beginning of RandomAgent be from gymnasium import Space?

Below, I've used RandomAgent in my submission.py file, similar to the example with DummyAgent.

class Submission:

    # Submission name
    NAME: str = "SUBMISSION NAME"

    # Name of your team
    TEAM: str = "TEAM NAME"

    # What is the name of the technique used? (e.g. Masked PPO)
    TECHNIQUE: str = "TECHNIQUE NAME"

    # Use this function to define your agents.
    AGENTS: dict[str, BaseAgent] = {
        f"blue_agent_{agent}": RandomAgent() for agent in range(5)
    }

    # Use this function to wrap CybORG with your custom wrapper(s).
    def wrap(env: CybORG) -> MultiAgentEnv:
        return EnterpriseMAE(env)

However, if I run the evaluation.py script, I get the following message because the action space is of type gymnasium.spaces.Discrete.

ValueError: Random agent can only handle Space or dict action space

If I change the import to from gymnasium import Space, the error goes away.

onaish-dstl commented 7 months ago

@MitchellKiely - Is this an issue on your end?

MitchellKiely commented 7 months ago

Apologies @rliu100 for the late reply, I just returned from leave. Yes, you are correct, this was a remnant from the previous CAGE challenges. Thanks for picking up on this mistake, I've pushed the changes to main.