From 08220ff6eabafacebb6ff5a22bdf437020fa3d05 Mon Sep 17 00:00:00 2001 From: Czar Echavez Date: Thu, 6 Jul 2023 13:27:44 +0100 Subject: [PATCH] #1386: remove redundant config files + test fixtures + fixing deterministic and seed config description in documentation to avoid misunderstandings --- docs/source/config.rst | 4 +- .../e2e/a2c_seeded_training_config.yaml | 155 ------------------ tests/e2e_integration_tests/__init__.py | 0 tests/e2e_integration_tests/conftest.py | 21 --- 4 files changed, 2 insertions(+), 178 deletions(-) delete mode 100644 tests/config/e2e/a2c_seeded_training_config.yaml delete mode 100644 tests/e2e_integration_tests/__init__.py delete mode 100644 tests/e2e_integration_tests/conftest.py diff --git a/docs/source/config.rst b/docs/source/config.rst index 50594549..afd012cc 100644 --- a/docs/source/config.rst +++ b/docs/source/config.rst @@ -310,11 +310,11 @@ Rewards are calculated based on the difference between the current state and ref * **deterministic** [bool] - Set to true if the agent should use deterministic actions. Default is ``False`` + Set to true if the agent evaluation should be deterministic. Default is ``False`` * **seed** [int] - Seed used in the randomisation in training / evaluation. Default is ``None`` + Seed used in the randomisation in agent training. Default is ``None`` The Lay Down Config ******************* diff --git a/tests/config/e2e/a2c_seeded_training_config.yaml b/tests/config/e2e/a2c_seeded_training_config.yaml deleted file mode 100644 index 90947726..00000000 --- a/tests/config/e2e/a2c_seeded_training_config.yaml +++ /dev/null @@ -1,155 +0,0 @@ -# Training Config File - -# Sets which agent algorithm framework will be used. -# Options are: -# "SB3" (Stable Baselines3) -# "RLLIB" (Ray RLlib) -# "CUSTOM" (Custom Agent) -agent_framework: SB3 - -# Sets which deep learning framework will be used (by RLlib ONLY). -# Default is TF (Tensorflow). -# Options are: -# "TF" (Tensorflow) -# TF2 (Tensorflow 2.X) -# TORCH (PyTorch) -deep_learning_framework: TF2 - -# Sets which Agent class will be used. -# Options are: -# "A2C" (Advantage Actor Critic coupled with either SB3 or RLLIB agent_framework) -# "PPO" (Proximal Policy Optimization coupled with either SB3 or RLLIB agent_framework) -# "HARDCODED" (The HardCoded agents coupled with an ACL or NODE action_type) -# "DO_NOTHING" (The DoNothing agents coupled with an ACL or NODE action_type) -# "RANDOM" (primaite.agents.simple.RandomAgent) -# "DUMMY" (primaite.agents.simple.DummyAgent) -agent_identifier: A2C - -# Sets whether Red Agent POL and IER is randomised. -# Options are: -# True -# False -random_red_agent: False - -# The (integer) seed to be used in random number generation -# Default is None (null) -seed: 12345 - -# Set whether the agent will be deterministic instead of stochastic -# Options are: -# True -# False -deterministic: True - -# Sets what view of the environment the deterministic hardcoded agent has. The default is BASIC. -# Options are: -# "BASIC" (The current observation space only) -# "FULL" (Full environment view with actions taken and reward feedback) -hard_coded_agent_view: FULL - -# Sets How the Action Space is defined: -# "NODE" -# "ACL" -# "ANY" node and acl actions -action_type: NODE -# observation space -observation_space: - # flatten: true - components: - - name: NODE_LINK_TABLE - # - name: NODE_STATUSES - # - name: LINK_TRAFFIC_LEVELS -# Number of episodes to run per session -num_episodes: 10 - -# Number of time_steps per episode -num_steps: 256 - -# Sets how often the agent will save a checkpoint (every n time episodes). -# Set to 0 if no checkpoints are required. Default is 10 -checkpoint_every_n_episodes: 0 - -# Time delay (milliseconds) between steps for CUSTOM agents. -time_delay: 5 - -# Type of session to be run. Options are: -# "TRAIN" (Trains an agent) -# "EVAL" (Evaluates an agent) -# "TRAIN_EVAL" (Trains then evaluates an agent) -session_type: TRAIN_EVAL - -# Environment config values -# The high value for the observation space -observation_space_high_value: 1000000000 - -# The Stable Baselines3 learn/eval output verbosity level: -# Options are: -# "NONE" (No Output) -# "INFO" (Info Messages (such as devices and wrappers used)) -# "DEBUG" (All Messages) -sb3_output_verbose_level: NONE - -# Reward values -# Generic -all_ok: 0 -# Node Hardware State -off_should_be_on: -10 -off_should_be_resetting: -5 -on_should_be_off: -2 -on_should_be_resetting: -5 -resetting_should_be_on: -5 -resetting_should_be_off: -2 -resetting: -3 -# Node Software or Service State -good_should_be_patching: 2 -good_should_be_compromised: 5 -good_should_be_overwhelmed: 5 -patching_should_be_good: -5 -patching_should_be_compromised: 2 -patching_should_be_overwhelmed: 2 -patching: -3 -compromised_should_be_good: -20 -compromised_should_be_patching: -20 -compromised_should_be_overwhelmed: -20 -compromised: -20 -overwhelmed_should_be_good: -20 -overwhelmed_should_be_patching: -20 -overwhelmed_should_be_compromised: -20 -overwhelmed: -20 -# Node File System State -good_should_be_repairing: 2 -good_should_be_restoring: 2 -good_should_be_corrupt: 5 -good_should_be_destroyed: 10 -repairing_should_be_good: -5 -repairing_should_be_restoring: 2 -repairing_should_be_corrupt: 2 -repairing_should_be_destroyed: 0 -repairing: -3 -restoring_should_be_good: -10 -restoring_should_be_repairing: -2 -restoring_should_be_corrupt: 1 -restoring_should_be_destroyed: 2 -restoring: -6 -corrupt_should_be_good: -10 -corrupt_should_be_repairing: -10 -corrupt_should_be_restoring: -10 -corrupt_should_be_destroyed: 2 -corrupt: -10 -destroyed_should_be_good: -20 -destroyed_should_be_repairing: -20 -destroyed_should_be_restoring: -20 -destroyed_should_be_corrupt: -20 -destroyed: -20 -scanning: -2 -# IER status -red_ier_running: -5 -green_ier_blocked: -10 - -# Patching / Reset durations -os_patching_duration: 5 # The time taken to patch the OS -node_reset_duration: 5 # The time taken to reset a node (hardware) -service_patching_duration: 5 # The time taken to patch a service -file_system_repairing_limit: 5 # The time take to repair the file system -file_system_restoring_limit: 5 # The time take to restore the file system -file_system_scanning_limit: 5 # The time taken to scan the file system diff --git a/tests/e2e_integration_tests/__init__.py b/tests/e2e_integration_tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/e2e_integration_tests/conftest.py b/tests/e2e_integration_tests/conftest.py deleted file mode 100644 index 2f569c9b..00000000 --- a/tests/e2e_integration_tests/conftest.py +++ /dev/null @@ -1,21 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -import polars as pl - - -def compare_transaction_file(output_a_file_path: str | Path, output_b_file_path: str | Path): - """Function used to check if contents of transaction files are the same.""" - # load output a file - data_a = pl.read_csv(output_a_file_path) - - # load output b file - data_b = pl.read_csv(output_b_file_path) - - # remove the time stamp column - data_a = data_a.drop("Timestamp") - data_b = data_b.drop("Timestamp") - - # if the comparison is empty, both files are the same i.e. True - return data_a.frame_equal(data_b)