forked from RocketPy-Team/RocketPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonte_carlo_prints.py
More file actions
30 lines (25 loc) · 1006 Bytes
/
monte_carlo_prints.py
File metadata and controls
30 lines (25 loc) · 1006 Bytes
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
26
27
28
29
30
class _MonteCarloPrints:
"""Class to print the monte carlo analysis results."""
def __init__(self, monte_carlo):
self.monte_carlo = monte_carlo
def all(self):
"""Print the mean and standard deviation of each parameter in the results
dictionary or of the variables passed as argument.
Parameters
----------
None
Returns
-------
None
"""
print("Monte Carlo Simulation by RocketPy")
print("Data Source: ", self.monte_carlo.filename)
print("Number of simulations: ", self.monte_carlo.num_of_loaded_sims)
print("Results: \n")
print(f"{'Parameter':>25} {'Mean':>15} {'Std. Dev.':>15}")
print("-" * 60)
for key, value in self.monte_carlo.processed_results.items():
try:
print(f"{key:>25} {value[0]:>15.3f} {value[1]:>15.3f}")
except TypeError:
print(f"{key:>25} {str(value[0]):>15} {str(value[1]):>15}")