31 lines
702 B
Python
31 lines
702 B
Python
"""
|
|
sb策略以及变种在15轮时的团体平均收益
|
|
"""
|
|
|
|
import numpy as np
|
|
from matplotlib import pyplot as plt
|
|
|
|
x = np.arange(0,1,0.0001)
|
|
omega = np.ceil(5/(3-(x*2.6)))
|
|
fb0 = 5-omega*(3-(x*2.6+(1-x)*4.5))
|
|
fb = fb0 - (15-omega)*(3-2.6)
|
|
y = fb/2
|
|
|
|
ymax = 0
|
|
xmax = 0
|
|
for i in range(len(x)):
|
|
if y[i] > ymax:
|
|
ymax = y[i]
|
|
xmax = x[i]
|
|
print(xmax, ymax)
|
|
exit()
|
|
fig = plt.figure(figsize=(6.4,3.6))
|
|
ax = fig.gca()
|
|
ax.plot(x,y, marker='.', markersize=3, color='#0984e3', linestyle='None')
|
|
ax.plot(x,np.full(x.shape, 1.4), linestyle='dashed', linewidth=1, color='#aaaaaa')
|
|
ax.set_xlim(0,1)
|
|
# ax.set_ylim(0,2)
|
|
ax.set_xlabel(r'$p$')
|
|
ax.set_ylabel(r'$f_b(15)$')
|
|
plt.tight_layout()
|
|
plt.show() |