[6de8ee]: Test / examples / knapsack.tst  Maximize  Restore  History

Download this file

19 lines (14 with data), 511 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# knapsack.tst
>>> import sys
>>> import pyke
>>> import os
>>> new_path = os.path.join(os.path.dirname(os.path.dirname(pyke.__file__)),
... 'examples/knapsack')
>>> sys.path.append(new_path)
>>> import driver
>>> driver.run((('bread', 4, 9200),
... ('pasta', 2, 4500),
... ('peanutButter', 1, 6700),
... ('babyFood', 3, 6900)),
... 4)
(13600, (('peanutButter', 1, 6700), ('babyFood', 3, 6900)))

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks