1
from mpl_toolkits.mplot3d import Axes3D
2
from matplotlib import cm
3
from matplotlib.colors import LogNorm
4
import matplotlib.pyplot as plt
13
sys.path.append("../..")
14
from deap import benchmarks
17
def griewank_arg0(sol):
18
return benchmarks.griewank(sol)[0]
21
ax = Axes3D(fig, azim = -29, elev = 40)
23
X = np.arange(-50, 50, 0.5)
24
Y = np.arange(-50, 50, 0.5)
25
X, Y = np.meshgrid(X, Y)
28
for i in xrange(X.shape[0]):
29
for j in xrange(X.shape[1]):
30
Z[i,j] = griewank_arg0((X[i,j],Y[i,j]))
32
ax.plot_surface(X, Y, Z, rstride = 1, cstride = 1, cmap = cm.jet, linewidth=0.2, )
b'\\ No newline at end of file'