From 2547361dafdd4340d734de9c3ca045bea99c1c77 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Thu, 7 Mar 2024 13:52:26 +0000 Subject: [PATCH 1/3] Change default reward weights --- .../config/_package_data/example_config.yaml | 10 ++++----- .../example_config_2_rl_agents.yaml | 21 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/primaite/config/_package_data/example_config.yaml b/src/primaite/config/_package_data/example_config.yaml index d0ba61b0..dffb40ea 100644 --- a/src/primaite/config/_package_data/example_config.yaml +++ b/src/primaite/config/_package_data/example_config.yaml @@ -691,25 +691,25 @@ agents: reward_function: reward_components: - type: DATABASE_FILE_INTEGRITY - weight: 0.34 + weight: 0.40 options: node_hostname: database_server folder_name: database file_name: database.db - type: WEBPAGE_UNAVAILABLE_PENALTY - weight: 0.33 + weight: 0.25 options: node_hostname: client_1 - type: WEBPAGE_UNAVAILABLE_PENALTY - weight: 0.33 + weight: 0.25 options: node_hostname: client_2 - type: GREEN_ADMIN_DATABASE_UNREACHABLE_PENALTY - weight: 0.1 + weight: 0.05 options: node_hostname: client_1 - type: GREEN_ADMIN_DATABASE_UNREACHABLE_PENALTY - weight: 0.1 + weight: 0.05 options: node_hostname: client_2 diff --git a/src/primaite/config/_package_data/example_config_2_rl_agents.yaml b/src/primaite/config/_package_data/example_config_2_rl_agents.yaml index 575182a8..f7288cb0 100644 --- a/src/primaite/config/_package_data/example_config_2_rl_agents.yaml +++ b/src/primaite/config/_package_data/example_config_2_rl_agents.yaml @@ -695,25 +695,25 @@ agents: reward_function: reward_components: - type: DATABASE_FILE_INTEGRITY - weight: 0.34 + weight: 0.40 options: node_hostname: database_server folder_name: database file_name: database.db - type: WEBPAGE_UNAVAILABLE_PENALTY - weight: 0.33 + weight: 0.25 options: node_hostname: client_1 - type: WEBPAGE_UNAVAILABLE_PENALTY - weight: 0.33 + weight: 0.25 options: node_hostname: client_2 - type: GREEN_ADMIN_DATABASE_UNREACHABLE_PENALTY - weight: 0.1 + weight: 0.05 options: node_hostname: client_1 - type: GREEN_ADMIN_DATABASE_UNREACHABLE_PENALTY - weight: 0.1 + weight: 0.05 options: node_hostname: client_2 @@ -1251,29 +1251,28 @@ agents: - node_name: security_suite nic_num: 2 - reward_function: reward_components: - type: DATABASE_FILE_INTEGRITY - weight: 0.34 + weight: 0.40 options: node_hostname: database_server folder_name: database file_name: database.db - type: WEBPAGE_UNAVAILABLE_PENALTY - weight: 0.33 + weight: 0.25 options: node_hostname: client_1 - type: WEBPAGE_UNAVAILABLE_PENALTY - weight: 0.33 + weight: 0.25 options: node_hostname: client_2 - type: GREEN_ADMIN_DATABASE_UNREACHABLE_PENALTY - weight: 0.1 + weight: 0.05 options: node_hostname: client_1 - type: GREEN_ADMIN_DATABASE_UNREACHABLE_PENALTY - weight: 0.1 + weight: 0.05 options: node_hostname: client_2 From 17d4807660b4a5deebd02f82970cb711c50c9601 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Thu, 7 Mar 2024 14:33:21 +0000 Subject: [PATCH 2/3] Rename configs --- .../{example_config.yaml => data_manipulation.yaml} | 0 ...mple_config_2_rl_agents.yaml => data_manipulation_marl.yaml} | 0 src/primaite/config/load.py | 2 +- src/primaite/notebooks/training_example_ray_multi_agent.ipynb | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename src/primaite/config/_package_data/{example_config.yaml => data_manipulation.yaml} (100%) rename src/primaite/config/_package_data/{example_config_2_rl_agents.yaml => data_manipulation_marl.yaml} (100%) diff --git a/src/primaite/config/_package_data/example_config.yaml b/src/primaite/config/_package_data/data_manipulation.yaml similarity index 100% rename from src/primaite/config/_package_data/example_config.yaml rename to src/primaite/config/_package_data/data_manipulation.yaml diff --git a/src/primaite/config/_package_data/example_config_2_rl_agents.yaml b/src/primaite/config/_package_data/data_manipulation_marl.yaml similarity index 100% rename from src/primaite/config/_package_data/example_config_2_rl_agents.yaml rename to src/primaite/config/_package_data/data_manipulation_marl.yaml diff --git a/src/primaite/config/load.py b/src/primaite/config/load.py index 6bd0d80d..d5acd690 100644 --- a/src/primaite/config/load.py +++ b/src/primaite/config/load.py @@ -37,7 +37,7 @@ def data_manipulation_config_path() -> Path: :return: Path to the example config. :rtype: Path """ - path = _EXAMPLE_CFG / "example_config.yaml" + path = _EXAMPLE_CFG / "data_manipulation.yaml" if not path.exists(): msg = f"Example config does not exist: {path}. Have you run `primaite setup`?" _LOGGER.error(msg) diff --git a/src/primaite/notebooks/training_example_ray_multi_agent.ipynb b/src/primaite/notebooks/training_example_ray_multi_agent.ipynb index 4ef02443..76623697 100644 --- a/src/primaite/notebooks/training_example_ray_multi_agent.ipynb +++ b/src/primaite/notebooks/training_example_ray_multi_agent.ipynb @@ -35,7 +35,7 @@ "\n", "# If you get an error saying this config file doesn't exist, you may need to run `primaite setup` in your command line\n", "# to copy the files to your user data path.\n", - "with open(PRIMAITE_PATHS.user_config_path / 'example_config/example_config_2_rl_agents.yaml', 'r') as f:\n", + "with open(PRIMAITE_PATHS.user_config_path / 'example_config/data_manipulation_marl.yaml', 'r') as f:\n", " cfg = yaml.safe_load(f)\n", "\n", "ray.init(local_mode=True)" From 618da8abe9ebb0b471c8b88ca49db87090ae4855 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Thu, 7 Mar 2024 15:25:11 +0000 Subject: [PATCH 3/3] Rename notebooks --- ..._ray_multi_agent.ipynb => Training-an-RLLIB-MARL-System.ipynb} | 0 ...ample_ray_single_agent.ipynb => Training-an-RLLib-Agent.ipynb} | 0 .../{training_example_sb3.ipynb => Training-an-SB3-Agent.ipynb} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename src/primaite/notebooks/{training_example_ray_multi_agent.ipynb => Training-an-RLLIB-MARL-System.ipynb} (100%) rename src/primaite/notebooks/{training_example_ray_single_agent.ipynb => Training-an-RLLib-Agent.ipynb} (100%) rename src/primaite/notebooks/{training_example_sb3.ipynb => Training-an-SB3-Agent.ipynb} (100%) diff --git a/src/primaite/notebooks/training_example_ray_multi_agent.ipynb b/src/primaite/notebooks/Training-an-RLLIB-MARL-System.ipynb similarity index 100% rename from src/primaite/notebooks/training_example_ray_multi_agent.ipynb rename to src/primaite/notebooks/Training-an-RLLIB-MARL-System.ipynb diff --git a/src/primaite/notebooks/training_example_ray_single_agent.ipynb b/src/primaite/notebooks/Training-an-RLLib-Agent.ipynb similarity index 100% rename from src/primaite/notebooks/training_example_ray_single_agent.ipynb rename to src/primaite/notebooks/Training-an-RLLib-Agent.ipynb diff --git a/src/primaite/notebooks/training_example_sb3.ipynb b/src/primaite/notebooks/Training-an-SB3-Agent.ipynb similarity index 100% rename from src/primaite/notebooks/training_example_sb3.ipynb rename to src/primaite/notebooks/Training-an-SB3-Agent.ipynb