-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_best_solutions.py
32 lines (26 loc) · 991 Bytes
/
get_best_solutions.py
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
31
32
import pandas as pd
# reads maintenance results, selects n best and prints a table
def tbm_new_sets(n):
df = pd.read_csv('tbm_results_50y_top5_new.txt')
#df = pd.read_csv('tbm_results_50y.txt')
df.sort_values('Profit',ascending=False,inplace=True)
df = df[df["Profit"] != 0]
del df["Profit"]
df = df.reset_index(drop=True)
print("param: winding_period cooling_system_period ops_period oil_period :=")
print(df.head(n).to_string(header=False))
print(';')
return df.head(n)
def cbm_new_sets(n):
df = pd.read_csv('cbm_results_50y_top30_degr.txt')
df.sort_values('Profit',ascending=False,inplace=True)
df = df[df["Profit"] != 0]
df = df[df["Winding"] < 1]
del df["Profit"]
df = df.reset_index(drop=True)
print("param: winding_threshold cooling_system_threshold ops_threshold oil_threshold :=")
print(df.head(n).to_string(header=False))
print(';')
return df.head(n)
#df = tbm_new_sets(1)
df = cbm_new_sets(5)