| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import pandas as pd
- import numpy as np
- # file_path = 'benchmarks/Results/Agents/Time/LI_baseline.csv'
- file_path = 'benchmarks/Results/PyPDEVS/Time/minimal/LI_baseline.csv'
- # file_path = 'benchmarks/Results/PyPDEVS/Time/parallel/HOmod_baseline.csv'
- target_width = 200
- target_depth = 200
- def format_to_latex(mean, std):
- if std == 0:
- return f"${mean:.3f} \\pm 0.000$"
- std_magnitude = int(np.floor(np.log10(abs(std))))
- decimal_places = -std_magnitude
- if decimal_places >= 0:
- formatted_mean = f"{mean:.{decimal_places}f}"
- formatted_std = f"{std:.{decimal_places}f}"
- else:
- formatted_mean = f"{round(mean, decimal_places):.0f}"
- formatted_std = f"{round(std, decimal_places):.0f}"
- return f"${formatted_mean} \\pm {formatted_std}$"
- try:
- df = pd.read_csv(file_path)
- filtered_df = df[(df['depth'] == target_depth) & (df['width'] == target_width)]
- if filtered_df.empty:
- print(f"No rows found matching Depth={target_depth} and Width={target_width}.")
- else:
- combined_time = filtered_df['creation_time'] + filtered_df['setup_time'] + filtered_df['simulation_time']
- mean_val = combined_time.mean()
- std_sample = combined_time.std()
- latex_code = format_to_latex(mean_val, std_sample)
- print(f"--- Results for Width: {target_width} | Height: {target_depth} ---")
- print(f"Number of runs found: {len(filtered_df)}")
- print(f"Mean Combined Time: {mean_val:.6f} seconds")
- print(f"Standard Deviation: {std_sample:.6f} seconds")
- print("\n--- Copyable LaTeX Code ---")
- print(latex_code)
- except FileNotFoundError:
- print(f"Error: The file '{file_path}' could not be found. Please check the path and try again.")
- except Exception as e:
- print(f"An error occurred: {e}")
|