Final OPL Project Code (2 Days)

Final OPL Project Code (2 Days) - Appendix 2 {string} food...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Appendix 2 {string} food = . ..; {string} meal = {"B", "L", "D"}; {string} day = {"D1", "D2"}; //Float float Cost[food]=. ..; float Calories[food]=. ..; float Fat[food]=. ..; float Cholesterol[food]=. ..; float Sodium[food]=. ..; float Carbs[food]=. ..; float Fiber[food]=. ..; float Sugar[food]=. ..; float Protien[food]=. ..; float VitaminA[food]=. ..; float VitaminC[food]=. ..; float VitaminD[food]=. ..; float Calcium[food]=. ..; float Iron[food]=. ..; float Zinc[food]=. ..; float Meat[food]=. ..; float Dairy[food]=. ..; float Vegetable[food]=. ..; float Fruit[food]=. ..; float Grain[food]=. ..; float mealData[food][meal]=. ..; //Decision Variables dvar int x[day][food][meal] in 0. .1; //Objective Function minimize sum(i in day, j in food, k in meal) Cost[j]*x[i][j][k];
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
//Constraints subject to { //cant eat same thing twice forall (j in food) x["D1"][j]["B"]+ x["D2"][j]["B"]<=1; forall (j in food) x["D1"][j]["L"]+ x["D2"][j]["L"]<=1; forall (j in food) x["D1"][j]["D"]+ x["D2"][j]["D"]<=1; //must eat 10 items sum(i in day, j in food, k in meal)x[i][j][k]>=10; //Cost sum(i in day, j in food, k in meal) Cost[j]*x[i][j][k]>=0; sum(i in day, j in food, k in meal) Cost[j]*x[i][j][k]<=20; //Calories sum(i in day, j in food, k in meal) Calories[j]*x["D1"][j][k]>=1800;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/21/2008 for the course IE 210 taught by Professor ?? during the Spring '08 term at Clemson.

Page1 / 4

Final OPL Project Code (2 Days) - Appendix 2 {string} food...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online