Skip to content

Commit d7e42f1

Browse files
committed
figure edits
1 parent f179455 commit d7e42f1

52 files changed

Lines changed: 127292 additions & 123604 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
24.8 KB
Loading

baseline_controllers/bouc_example.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ def observer_unconstrained(query_points):
6161
def create_bo_model(data):
6262
gpr = build_gpr(data, search_space)
6363
return GaussianProcessRegression(gpr)
64+
6465
# set the random seed
66+
rand_seed = 42
67+
np.random.seed(rand_seed)
6568

6669
search_space = Box([1.0], [2.0])
6770
num_init_points = 4
68-
num_steps = 6
71+
num_steps = 4
6972
init_data_cons = observer_constrained(search_space.sample(num_init_points))
7073
init_query_points = init_data_cons[OBJECTIVE].query_points
7174
init_data_uncons = observer_unconstrained(init_query_points)
@@ -82,6 +85,26 @@ def create_bo_model(data):
8285
final_string = "Final\nn = " + str(num_init_points + num_steps)
8386
ax[1,0].set_ylabel(final_string,fontsize='x-large',rotation=0,labelpad=25)
8487

88+
# annotate f'(x) in math script on ax[0,0], bottom right corner
89+
ax[0,0].annotate(r"$f'(x)$", xy=(0.1, 0.85), xycoords='axes fraction', ha='center', va='center',fontsize='xx-large')
90+
ax[1,0].annotate(r"$f'(x)$", xy=(0.1, 0.85), xycoords='axes fraction', ha='center', va='center',fontsize='xx-large')
91+
92+
# annotate f(x) in math script on ax[1,0], bottom left
93+
ax[0,1].annotate(r"$f(x)$", xy=(0.1, 0.2), xycoords='axes fraction', ha='center', va='center',fontsize='xx-large')
94+
ax[1,1].annotate(r"$f(x)$", xy=(0.1, 0.2), xycoords='axes fraction', ha='center', va='center',fontsize='xx-large')
95+
96+
97+
# annotate c(x) at (0.8, 0.5) in figure coordinates (not axis)
98+
#ax[0,1].annotate(r"$c(x)$", xy=(0.8, -0.1), xycoords='axes fraction', ha='center', va='center',fontsize='xx-large')
99+
100+
# get rid of xticks on ax[0,0] and ax[0,1]
101+
ax[0,0].set_xticks([])
102+
ax[0,1].set_xticks([])
103+
104+
# set xlabel for ax[1,0] and ax[1,1] as "x" in math script
105+
ax[1,0].set_xlabel(r"$x$",fontsize='xx-large')
106+
ax[1,1].set_xlabel(r"$x$",fontsize='xx-large')
107+
85108
# for both the unconstrained plots, plot the true objective function
86109
x = np.linspace(1, 2, 500).reshape(-1,1)
87110
y = Sim_unconstrained.objective(tf.convert_to_tensor(x))
@@ -116,9 +139,10 @@ def create_bo_model(data):
116139
#cbar = plt.colorbar(ax[0,1].collections[0], ax=ax[0,1],cmap='RdBu')
117140
cbar = fig.colorbar(mesh,location='bottom')
118141
cbar.set_ticks([0,0.5, 1])
119-
cbar.set_ticklabels(["Certainly\nInfeasible","Inferred\nThreshold\nValue", "Certainly\nFeasible"])
142+
cbar.set_ticklabels(["Certainly\nInfeasible","Inferred\nThreshold of $c(x)$", "Certainly\nFeasible"])
143+
144+
ax[0,0].legend(loc = 'lower right',fontsize='large')
120145

121-
ax[0,0].legend()
122146

123147
#plt.show()
124148

baseline_controllers/delta/evaluate_baseline_controllers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
1+
'''
22
# install pystorms from the current directory (this should be commented out in final version once pystorms source code isn't changing all the time)
33
import subprocess
44
import sys
55
from tkinter import Y
66
subprocess.check_call([sys.executable, '-m', 'pip', 'uninstall', '-y', 'pystorms'])
77
subprocess.check_call([sys.executable, '-m', 'pip', 'cache', 'purge'])
88
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '.'])
9-
9+
'''
1010
import pystorms # this will be the first line of the program when dev is done
1111
import copy
1212
import pyswmm
@@ -27,7 +27,7 @@
2727
evaluating = 'prop-outflow'
2828
verbose = True
2929
version = "2" # options are "1" and "2"
30-
level = "1" # options are "1" , "2", and "3"
30+
level = "3" # options are "1" , "2", and "3"
3131
plot = True # plot True significantly increases the memory usage.
3232
# set the working directory to the directory of this script
3333
os.chdir(os.path.dirname(os.path.abspath(__file__)))
-261 Bytes
Loading

0 commit comments

Comments
 (0)