reset; printf("Corrida de modelo "&date("%Y%m%d %H.%M.%S")); model TSOP.mod; data GPFS1.dat; option solver gurobi; option gurobi_options "outlev=1 logfreq=5 mipgap=0.001 timelim=3600"; option log_file ("log_timetable"& date("%Y%m%d %H.%M.%S") &".log"); solve; printf ("\n\n\n\nSOLUCIÓN para MOSTRAR\n"); option omit_zero_rows 1; display x; display w; display B; display Max_bloq; # Para mostrar horario por profesor param HorP{p in P, d in D, h in H, i in Gp[p], j in Cg[i], m in Mp[p] inter Mg[i]} default 0; for{p in P, d in D, h in H, i in Gp[p], j in Cg[i], m in Mp[p] inter Mg[i]}{ let HorP[p,d,h,i,j,m]:= if(x[i,j,d,h,m]==1 and w[p,i,j,m]==1 ) then 1 else 0; } display HorP; if (Max_bloq <> 0) then{ for{p in P}{ for{d in D, h in H,i in Gp[p], j in Cg[i], m in Mp[p] inter Mg[i]}{ if (HorP[p,d,h,i,j,m]==1) then printf(p&", "& d &", "& h &":= "&i&","&j&" - "&m&"\n"); } printf("\n"); } } if (Max_bloq <> 0) then{ for{i in G, j in Cg[i]}{ for{ d in D, h in H,p in Pg[i], m in Mp[p] inter Mg[i]}{ if (HorP[p,d,h,i,j,m]==1) then printf(i&","&j&" - "&d&", "& h &", "&p&" - "&m&"\n"); } printf("\n"); } }