-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiet.mpl
55 lines (36 loc) · 1.7 KB
/
Diet.mpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ Diet.mpl }
{
This model determines a least cost diet which meets the daily
allowances of nutrients for a man weighing 154 lbs.
Reference: G. B. Dantzig, Linear Programming and Extensions,
Princeton University Press, Princeton, New Jersey, 1963.
}
TITLE
Stiglers_nutrition_model
INDEX
nutrients = (Calorie,Protein,Calcium,Iron,Avitamin
Thiamine,Riboflavin,Niacin,Cvitamin) : 10
foods = (WheatFlour,CornMeal,EvapMilk,Margarine,
Cheese,Lard,Liver,PorkRoast,Salmon,
GreenBeans,Cabbage,Onions,Potatoes,Spinach,
SweetPot,Peaches,Prunes,LimaBeans,NavyBeans) : 10
DATA
Required[nutrients] = ( 3 ! Calories [thousands]
70 ! Protein [grams]
0.8 ! Calcium [grams]
12 ! Iron [milligrams]
5 ! Avitamin [thousand ius]
1.8 ! Thiamine (B1) [milligrams]
2.7 ! Riboflavin (B2) [milligrams]
18 ! Niacin [milligrams]
75 ) ; ! Cvitamin [milligrams]
A[foods,nutrients] = DATAFILE(nutri.dat) ! Nutritive values of foods
! per dollar expenditure.
DECISION
x[foods] -> "" ! dollars of food to be purchased daily
MODEL
MIN Cost = SUM(foods: x) ;
SUBJECT TO
NutrBal[nutrients] -> "" : SUM(foods: A*x) > Required[nutrients];
END