Beispiel #1
0
def default_config() -> ClientConfig:
    """
    :return: Default configuration for the experiment
    """
    simulation_config = SimulationConfig(
        render=False,
        sleep=0.8,
        video=True,
        log_frequency=1,
        video_fps=5,
        video_dir=default_output_dir() + "/videos",
        num_episodes=1000,
        gifs=True,
        gif_dir=default_output_dir() + "/gifs",
        video_frequency=1)
    env_name = "idsgame-v3"
    client_config = ClientConfig(
        env_name=env_name,
        attacker_type=AgentType.RANDOM.value,
        defender_type=AgentType.DEFEND_MINIMAL_VALUE.value,
        mode=RunnerMode.SIMULATE.value,
        simulation_config=simulation_config,
        output_dir=default_output_dir(),
        title="RandomAttacker vs DefendMinimalDefender")
    return client_config
Beispiel #2
0
def default_config() -> ClientConfig:
    """
    :return: Default configuration for the experiment
    """
    simulation_config = SimulationConfig(
        render=True,
        sleep=0.8,
        video=True,
        log_frequency=1,
        video_fps=5,
        video_dir=default_output_dir() + "/videos",
        num_episodes=1000,
        gifs=True,
        gif_dir=default_output_dir() + "/gifs",
        video_frequency=1)
    q_agent_config = QAgentConfig(attacker_load_path=default_output_dir() +
                                  "/q_table/attacker_q_table.npy",
                                  defender_load_path=default_output_dir() +
                                  "/q_table/defender_q_table.npy")
    env_name = "idsgame-v3"
    client_config = ClientConfig(
        env_name=env_name,
        attacker_type=AgentType.TABULAR_Q_AGENT.value,
        defender_type=AgentType.TABULAR_Q_AGENT.value,
        mode=RunnerMode.SIMULATE.value,
        simulation_config=simulation_config,
        output_dir=default_output_dir(),
        title="TabularQAgentAttacker vs TabularQAgentDefender",
        q_agent_config=q_agent_config,
        initial_state_path=default_output_dir() +
        "/initial_state/initial_state.pkl")
    return client_config
Beispiel #3
0
def test_sim_random_vs_random(version) -> ClientConfig:
    simulation_config = SimulationConfig(log_frequency=1, num_episodes=10)
    env_name = "idsgame-v" + str(version)
    client_config = ClientConfig(env_name=env_name,
                                 attacker_type=AgentType.RANDOM.value,
                                 defender_type=AgentType.RANDOM.value,
                                 mode=RunnerMode.SIMULATE.value,
                                 simulation_config=simulation_config,
                                 output_dir=default_output_dir(),
                                 title="RandomAttacker vs RandomDefender")
    Runner.run(client_config)
Beispiel #4
0
def test_sim_random_vs_defend_minimal(version) -> ClientConfig:
    simulation_config = SimulationConfig(log_frequency=1, num_episodes=10)
    env_name = "idsgame-v" + str(version)
    client_config = ClientConfig(
        env_name=env_name,
        attacker_type=AgentType.RANDOM.value,
        defender_type=AgentType.DEFEND_MINIMAL_VALUE.value,
        mode=RunnerMode.SIMULATE.value,
        simulation_config=simulation_config,
        output_dir=default_output_dir())
    Runner.run(client_config)