summaryrefslogtreecommitdiff
path: root/opendc-experiments/opendc-experiments-m3sa/src/main/python/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-experiments/opendc-experiments-m3sa/src/main/python/utils.py')
-rw-r--r--opendc-experiments/opendc-experiments-m3sa/src/main/python/utils.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/opendc-experiments/opendc-experiments-m3sa/src/main/python/utils.py b/opendc-experiments/opendc-experiments-m3sa/src/main/python/utils.py
new file mode 100644
index 00000000..fd4fec2e
--- /dev/null
+++ b/opendc-experiments/opendc-experiments-m3sa/src/main/python/utils.py
@@ -0,0 +1,25 @@
+import sys
+
+"""
+Constants for the main.py file
+"""
+
+SIMULATION_ANALYSIS_FOLDER_NAME = 'simulation-analysis'
+EMISSIONS_ANALYSIS_FOLDER_NAME = 'carbon_emission'
+ENERGY_ANALYSIS_FOLDER_NAME = 'power_draw'
+
+"""
+Utility functions
+"""
+
+
+def clean_analysis_file(metric):
+ analysis_file_path = SIMULATION_ANALYSIS_FOLDER_NAME + "/"
+ if metric == "power_draw":
+ analysis_file_path += ENERGY_ANALYSIS_FOLDER_NAME
+ else:
+ analysis_file_path += EMISSIONS_ANALYSIS_FOLDER_NAME
+ analysis_file_path += "/analysis.txt"
+
+ with open(analysis_file_path, "w") as f:
+ f.write("")