Skip to content

Commit 99d0d4d

Browse files
committed
- default is PC
- readme file improved
1 parent fe29fd6 commit 99d0d4d

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

GLIS_BO_analysis.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
algo = 'GLIS'
1818
#algo = 'BO'
1919

20-
machine = 'PC'
21-
#machine = 'PI'
20+
machine = 'PI' # PC or PI
2221
eps_calc = 1.0
2322
iter_max_plot = 500
2423

@@ -153,16 +152,18 @@ def xref_fun_def(t):
153152
ax.legend(loc='upper right')
154153

155154
axes[0].set_xlim((0, iter_max_plot))
156-
axes[0].set_ylim((-1, 19))
155+
axes[0].set_ylim((-1, 25))
157156

158157
fig_name = f"ITER_{algo}_{machine}.pdf"
159158
fig_path = os.path.join(FIG_FOLDER, fig_name)
160159
fig.savefig(fig_path, bbox_inches='tight')
161160

162161

163162
# In[Recompute optimum]
163+
#print(Y_best_val)
164+
164165
J_opt = f_x(x_opt, eps_calc=results['eps_calc'])
165-
print(J_opt)
166+
#print(J_opt)
166167

167168
# In[Optimization computation time]
168169

GLIS_BO_main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
if __name__ == '__main__':
1717

18-
np.random.seed(10)
18+
np.random.seed(2)
1919
# initial random points
2020

2121
# optimization parameters
@@ -28,8 +28,8 @@
2828

2929
# method = 'BO'
3030
method = "GLIS"
31-
machine = 'PC'
32-
#machine = 'PI'
31+
machine = 'PI' # PC or PI
32+
3333

3434
dict_x0 = {
3535
'QDu_scale': 0.1,

objective_function.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,12 @@ def f_x(x, eps_calc=1.0, seed_val=None):
149149
# J_perf = 2e1
150150
# J_fit = 2e1
151151

152-
print(f"N_eval: {N_eval}, J_perf:{J_perf:.2f}, J_calc:{J_calc:.2f}, J_emergency:{J_emergency:.2f}")
152+
J_cl = np.log(J_perf) + np.log(1 + J_calc) + np.log(1+J_emergency)
153+
154+
print(f"N_eval: {N_eval}, J_perf:{J_perf:.2f}, J_calc:{J_calc:.2f}, J_emergency:{J_emergency:.2f}, J_cl:{J_cl:.2f}")
153155
N_eval += 1
154156

155-
return np.log(J_perf) + np.log(1 + J_calc + J_emergency) # + J_fit
157+
return J_cl # + J_fit
156158

157159

158160
if __name__ == '__main__':

0 commit comments

Comments
 (0)