summaryrefslogtreecommitdiff
path: root/prolog/problems/clp_r/turkey_3
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-08-18 16:06:19 +0200
committerAleš Smodiš <aless@guru.si>2015-08-18 16:06:19 +0200
commit95e2fe57f6e4639f6ae9f1fef368829d5090dbf6 (patch)
tree462ba05eb0c4732ca1c97739548801258bf47b40 /prolog/problems/clp_r/turkey_3
Exported all problems from the SQLite database into the new directory structure.
Diffstat (limited to 'prolog/problems/clp_r/turkey_3')
-rw-r--r--prolog/problems/clp_r/turkey_3/common.py15
-rw-r--r--prolog/problems/clp_r/turkey_3/en.py10
2 files changed, 25 insertions, 0 deletions
diff --git a/prolog/problems/clp_r/turkey_3/common.py b/prolog/problems/clp_r/turkey_3/common.py
new file mode 100644
index 0000000..6a99fc4
--- /dev/null
+++ b/prolog/problems/clp_r/turkey_3/common.py
@@ -0,0 +1,15 @@
+id = 161
+group = 'clp_r'
+number = 64
+visible = True
+facts = None
+
+solution = '''\
+turkey(Brand1, Brand2, Cost) :-
+ {Cost = Brand1*0.20 + Brand2*0.30,
+ A = Brand1*5 + Brand2*10,
+ B = Brand1*4 + Brand2*3,
+ C = Brand1*0.5,
+ A >= 90, B >= 48, C >= 1.5},
+ minimize(Cost).
+'''
diff --git a/prolog/problems/clp_r/turkey_3/en.py b/prolog/problems/clp_r/turkey_3/en.py
new file mode 100644
index 0000000..3117e35
--- /dev/null
+++ b/prolog/problems/clp_r/turkey_3/en.py
@@ -0,0 +1,10 @@
+id = 161
+name = 'turkey/3'
+slug = 'turkey feed'
+
+description = '''\
+<p>The Holiday Meal Turkey Ranch is considering buying two different brands of turkey feed and blending them to provide a good, low-cost diet for its turkeys. Each brand of feed contains, in varying proportions, some or all of the three nutritional ingredients essential for fattening turkeys. Each kilogram of brand 1 contains 5 grams of ingredient <code>A</code>, 4 grams of ingredient <code>B</code> and 0.5 grams of ingredient <code>C</code>. Each kilogram of brand 2 contains 10 grams of ingredient <code>A</code>, 3 grams of ingredient <code>B</code>, but nothing of ingredient <code>C</code>. The brand 1 feed costs 0.20 € a kilogram, while the brand 2 feed costs 0.30 € a kilogram.</p>
+<p>The minimum monthly requirement per turkey is: 90 grams of ingredient <code>A</code>; 48 grams of ingredient <code>B</code> and 1.5 grams of ingredient <code>C</code>.</p>
+<p>Formulate an LP model to help the rancher decide how to mix the two brands of turkey feed so that the minimum monthly intake requirement for each nutritional ingredient is met at minimum cost. Write the predicate <code>turkey(Brand1, Brand2, Cost)</code> that returns the amount (in kg) of brands 1 and 2 per turkey per month, and the total cost (in €).</p>'''
+
+hint = {}