Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
#import flo
|
||||
#import lin
|
||||
|
||||
items = # name: (weight,price)
|
||||
|
||||
<
|
||||
'beef ': (3.8,36.0),
|
||||
'pork ': (5.4,43.0),
|
||||
'ham ': (3.6,90.0),
|
||||
'greaves': (2.4,45.0),
|
||||
'flitch ': (4.0,30.0),
|
||||
'brawn ': (2.5,56.0),
|
||||
'welt ': (3.7,67.0),
|
||||
'salami ': (3.0,95.0),
|
||||
'sausage': (5.9,98.0)>
|
||||
|
||||
system = # a function to transform the item list to the data structure needed by the solver
|
||||
|
||||
linear_system$[
|
||||
lower_bounds: *nS ~&\0., # all zeros because we can't steal less than zero
|
||||
upper_bounds: ~&nmlPXS, # can't steal more than what's in the shop
|
||||
costs: * ^|/~& negative+ vid, # prices divided by weights, negated so as to maximize
|
||||
equations: ~&iNC\15.+ 1.-*@nS] # 1 equation constraining the total weight to 15
|
||||
|
||||
#cast %em
|
||||
|
||||
main = solution system items
|
||||
Loading…
Add table
Add a link
Reference in a new issue