-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_mc_violations.py
More file actions
38 lines (31 loc) · 3.57 KB
/
plot_mc_violations.py
File metadata and controls
38 lines (31 loc) · 3.57 KB
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
33
34
35
36
37
import matplotlib
import matplotlib.pyplot as plt
# font = {'family' : 'normal',
# # 'weight' : 'bold',
# 'size' : 15}
# matplotlib.rc('font', **font)
violation_statics_ci_obj2 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9998, 0.9894, 0.95282, 0.94542, 0.94814, 0.96058, 0.97544, 0.98624, 0.993, 0.9966, 0.99836, 0.99902, 0.9995, 0.99984, 0.99992, 0.99996, 0.99998, 0.99998, 0.99998, 0.99998, 0.99994, 0.99988, 0.99966, 0.99892, 0.9976, 0.99564, 0.99282, 0.99018, 0.98734]
violation_statics_mean_obj2 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.99798, 0.91612, 0.65376, 0.51694, 0.50758, 0.60238, 0.7759, 0.91908, 0.9784, 0.99482, 0.99832, 0.99954, 0.99988, 0.99994, 0.99994, 0.99994, 0.99996, 0.99996, 0.99996, 0.99988, 0.99986, 0.99964, 0.99936, 0.99802, 0.9964, 0.9944, 0.9925, 0.99056, 0.98844]
violation_statics_mean_obj1 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.99834, 0.93024, 0.67984, 0.51576, 0.50342, 0.60886, 0.78312, 0.91884, 0.97768, 0.99448, 0.99856, 0.9995, 0.99986, 0.99994, 0.99996, 0.99996, 0.99996, 0.99994, 0.9999, 0.99984, 0.99972, 0.99958, 0.99934, 0.99894, 0.99824, 0.9977, 0.99676, 0.99564, 0.99412]
violation_statics_ci_obj1 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.99994, 0.99454, 0.96706, 0.94944, 0.9501, 0.96088, 0.9744, 0.9858, 0.99344, 0.99754, 0.99918, 0.9997, 0.99986, 0.99992, 0.99998, 0.99998, 0.99998, 0.99998, 0.99996, 0.99996, 0.99996, 0.9999, 0.99984, 0.9998, 0.9997, 0.99964, 0.99956, 0.99944, 0.99926]
violation_statics_genut_ci_obj1 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.99994, 0.9941, 0.96666, 0.94784, 0.94916, 0.9595, 0.97306, 0.9848, 0.99248, 0.99676, 0.9988, 0.9996, 0.99992, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99996, 0.99992, 0.99986, 0.99978, 0.99966, 0.99942, 0.99932, 0.99926, 0.99918]
violation_statics_genut_mean_obj1 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.99876, 0.93244, 0.6803, 0.5131, 0.50428, 0.60658, 0.78302, 0.91752, 0.97672, 0.99446, 0.9983, 0.9996, 0.9999, 0.99992, 0.99996, 0.99996, 0.99996, 0.99996, 0.99994, 0.99986, 0.99984, 0.99964, 0.99922, 0.99878, 0.99818, 0.9974, 0.99642, 0.99504, 0.99336]
violation_statics_genut_mean_obj2 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9982, 0.91426, 0.6506, 0.51562, 0.50726, 0.60296, 0.77864, 0.9216, 0.98048, 0.99566, 0.99862, 0.99968, 0.99996, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.99998, 0.99992, 0.99986, 0.99938, 0.99834, 0.99688, 0.99498, 0.99304, 0.99134, 0.9891]
violation_statics_genut_ci_obj2 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.99982, 0.9896, 0.95232, 0.94346, 0.94604, 0.95862, 0.97396, 0.9849, 0.9925, 0.99664, 0.99834, 0.99884, 0.99938, 0.99966, 0.99982, 0.9999, 0.99992, 0.99994, 0.9999, 0.99988, 0.99978, 0.99972, 0.9995, 0.99886, 0.99718, 0.99524, 0.99316, 0.99088, 0.98762]
fig, ax = plt.subplots(1,1)
ax.plot(violation_statics_mean_obj1, 'b', label='Case 1')
ax.plot(violation_statics_ci_obj1,'g', label='Case 2')
# ax.plot(violation_statics_mean_obj2, 'r')
# ax.plot(violation_statics_ci_obj2, 'r')
ax.set_xlabel('Time Step')
ax.set_ylabel('Empirical Probability of Constraint Satisfaction')
# ax.plot(violation_statics_genut_mean_obj1, 'c')
# ax.plot(violation_statics_genut_ci_obj1,'c')
# ax.plot(violation_statics_genut_mean_obj2, 'm')
# ax.plot(violation_statics_genut_ci_obj2, 'm')
ax.legend()
ax.axhline(y = 0.95, color = 'k', linestyle='--')
ax.axhline(y=0.5, color = 'k', linestyle='--')
plt.savefig('constraint_satisfaction_probability.png')
plt.savefig('constraint_satisfaction_probability.eps')
plt.show()