~ubuntu-branches/ubuntu/utopic/deap/utopic-proposed

« back to all changes in this revision

Viewing changes to doc/_scripts/griewank.py

  • Committer: Package Import Robot
  • Author(s): Daniel Stender, Miriam Ruiz, Daniel Stender, Jakub Wilk
  • Date: 2014-07-06 00:03:41 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140706000341-s7gij1ki3d8xz6t9
Tags: 1.0.1-1
[ Miriam Ruiz ]
* New Upstream Release. Closes: #675200
* Upgraded Standards-Version from 3.9.2 to 3.9.5
* Switched to dh_python2
* Upgraded debian/compat to 9
* Added build-arch and build-indep targets to debian/rules
* Using awk to remove connection from the documentation to google analytics
* Using jquery.js and underscore.js from libjs-jquery and libjs-underscore
* Added patches/doc.patch

[ Daniel Stender ]
* deb/control:
  + Added myself to Uploaders.
  + Added version to b-p on python-all.
  + Updated Homepage.
  + Wrapped and sorted.
* deb/copyright:
  + Changed copyright file towards DEP-5.
  + Updated Source URI (project source moved to Github).
  + Added email addresses for copyright holders.
  + Dropped license for eap/toolbox.py (not included anymore).
  + Extended copyrights to 2014.
  + Added myself to copyrights for deb/*.
  + Specified license location.
* Added watch file [initial version by Jackson Doak].

[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from mpl_toolkits.mplot3d import Axes3D
2
 
from matplotlib import cm
3
 
from matplotlib.colors import LogNorm
4
 
import matplotlib.pyplot as plt
5
 
import sys
6
 
 
7
 
try:
8
 
    import numpy as np
9
 
except:
10
 
    exit()
11
 
 
12
 
 
13
 
sys.path.append("../..")
14
 
from deap import benchmarks
15
 
 
16
 
 
17
 
def griewank_arg0(sol):
18
 
    return benchmarks.griewank(sol)[0]
19
 
 
20
 
fig = plt.figure()
21
 
ax = Axes3D(fig, azim = -29, elev = 40)
22
 
# ax = Axes3D(fig)
23
 
X = np.arange(-50, 50, 0.5)
24
 
Y = np.arange(-50, 50, 0.5)
25
 
X, Y = np.meshgrid(X, Y)
26
 
Z = np.zeros(X.shape)
27
 
 
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]))
31
 
 
32
 
ax.plot_surface(X, Y, Z, rstride = 1, cstride = 1, cmap = cm.jet, linewidth=0.2, )
33
 
 
34
 
plt.xlabel("x")
35
 
plt.ylabel("y")
36
 
 
37
 
plt.show()
 
 
b'\\ No newline at end of file'