summaryrefslogtreecommitdiff
path: root/opendc-experiments/opendc-experiments-m3sa/src/main/python/utils.py
blob: fd4fec2e781644e036f07a0c5c1bc2ece8a8ce23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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("")