Quiz1-key

# Quiz1-key - Question 1 AMPL MOD and DATA FILES set ITEM set...

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

Question 1- AMPL MOD and DATA FILES: set ITEM; set RESOURCE; param value{ITEM}; param avail{ITEM}; param amt{ITEM,RESOURCE}; param limit{RESOURCE}; var x{i in ITEM}>=0, <=avail[i]; maximize Tvalue: sum{j in ITEM}value[j]*x[j]; subject to res_con { j in RESOURCE}: sum{ i in ITEM}amt[i,j]*x[i]<=limit[j]; set ITEM:= TV radio camera CDPlayer VCR camcorder; set RESOURCE:=wei vol; param value:=TV 50 radio 15 camera 85 CDPlayer 40 VCR 50 camcorder 120; param avail:=TV 20 radio 50 camera 20 CDPlayer 30 VCR 30 camcorder 15; param amt (tr): TV radio camera CDPlayer VCR camcorder:= wei 35 5 4 3 15 20 vol 8 1 2 1 5 4; param limit:=wei 500 vol 300; MINOS 5.5: optimal solution found. 5 iterations, objective 4800 ampl: display x; x [*] := CDPlayer 30 ; TV 0 ; VCR 2 ; camcorder 15; camera 20 ; radio 0

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

View Full Document
Question 2 (Using 2-dimensional sets,vars) set From; set To; param cost{From, To}; param output{From}; param size{To}; var x{From, To}>=0; minimize TotCost: sum{i in From, j in To} cost[i,j]*x[i,j]; subject to supply_con { i in From}: sum{j in To} x[i,j]<=output[i];
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 07/08/2011 for the course IE 121 taught by Professor Perevalov during the Spring '08 term at Lehigh University .

### Page1 / 6

Quiz1-key - Question 1 AMPL MOD and DATA FILES set ITEM set...

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

View Full Document
Ask a homework question - tutors are online