Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Manuals/calci/Exampleslp
(view source)
Revision as of 08:25, 28 September 2018
720 bytes added
,
08:25, 28 September 2018
no edit summary
Line 14:
Line 14:
60,000 pounds of milk chocolate chips. How should Shannon schedule its production so that it can fill
60,000 pounds of milk chocolate chips. How should Shannon schedule its production so that it can fill
the order at minimum cost? What is the minimum cost?
the order at minimum cost? What is the minimum cost?
+
+
<div id="z3lp1" style="font-size:16px">'''z3 code: Chocolate Problem'''</div>
+
<source lang="cpp">
+
var solver = require('javascript-lp-solver'),
+
results,
+
model = {
+
"name": "Chocolate Problem",
+
"optimize": "cost",
+
"opType": "min",
+
"constraints": {
+
"semisweet": {
+
"min": 30000
+
},
+
"milk chocolate": {
+
"min": 60000
+
}
+
},
+
"variables": {
+
"Kansas": {
+
"semisweet": 3000,
+
"milk chocolate": 2000,
+
"cost": 1000
+
},
+
"Oklahoma": {
+
"semisweet": 1000,
+
"milk chocolate": 6000,
+
"cost": 1500
+
}
+
}
+
};
+
+
console.log(solver.Solve(model));</source>
Sahiti
writer
1,835
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Community portal
Current events
Recent changes
Help
Tools
ZCubes Web Platform
Printable version