soln 2 - Part(a An AMPL script reset option solver cplex...

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

View Full Document Right Arrow Icon
Part (a). An AMPL script : reset; option solver cplex; # delete this statement when using the professional version of AMPL # it uses cplex and allows no solver options model tutorialsv1.mod; data tutorialsv1_corr.dat; solve; option omit_zero_rows 1; option print_separator " "; print Total_Cost > ps10-2a_output ; print { j in DEST, i in ORIG : Trans[i,j] >= 1}: i, j, Trans[i,j], cost[i,j] >> ps10-2a_output ; # because of dummy need to condition on Assign[i,j]>= 1 rather than on Assign[i,j]= 1; Output: 48 Tutorial3 s1 1 2 Tutorial5 s2 1 2 Tutorial9 s3 1 3 Tutorial6 s4 1 2 Tutorial10 s5 1 3 Tutorial2 s6 1 1 Tutorial6 s7 1 1 Tutorial8 s8 1 2 Tutorial7 s9 1 3 Tutorial9 s10 1 2 Tutorial4 s11 1 1 Tutorial10 s12 1 3 Tutorial1 s13 1 1 Tutorial6 s14 1 3 Tutorial7 s15 1 2 Tutorial7 s16 1 3 Tutorial4 s17 1 1 Tutorial4 s18 1 2 Tutorial1 s19 1 1 Tutorial2 s20 1 1 Tutorial3 s21 1 1 Tutorial1 s22 1 1 Tutorial3 s23 1 3 Tutorial2 s24 1 1 Tutorial10 s25 1 3 Tutorial5 dummy 2 0 Tutorial8 dummy 2 0 Tutorial9 dummy 1 0 Dummy is NOT a student (at least not a 3300/5300 student). It is the name of a variable that is assigned zero obj fn coeffs for all course assignments and has demand 5, so that total demand = total supply = 30. 10 students assigned to first choice, 7 to second choice, and the remaining 8 to third, which gives an obj fn value of 48.
Background image of page 1

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

View Full Document Right Arrow Icon
Part (b). Aside from changing the name of the array of decision variables in the model file from Trans to the more apt name (for this problem) Assign, we have introduced parameters that specify the number of tutorials and the number of students and we now specify the origins and destinations as indices from 1 to the number of courses and 1 to the number of students plus one (the dummy). Script: reset; option solver cplex; # delete this statement when using the professional version of AMPL # it uses cplex and allows no solver options model tutorialsv2.mod; data tutorialsv2_corr.dat; solve; option omit_zero_rows 1; option print_separator " "; print Total_Cost > ps10-2b_output; print { j in DEST, i in ORIG : Assign[i,j] >= 1}:
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.

{[ snackBarMessage ]}

Page1 / 7

soln 2 - Part(a An AMPL script reset option solver cplex...

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