Hi, i’m trying to export the results of the schedules (assignment [c,r,d,t] =1) to excel, but i’m confused on how to do it.
load amplxl.dll;
table overall IN "amplxl" "timetable.xlsx" "overall":
CODE <- [CODE], program, section, course_num, course_title, room, lec, lab, teaching_load, building;
table rooms IN "amplxl" "timetable.xlsx" "rooms":
ROOMS <- [ROOMS], buildings, floor, type, lecture, laboratory;
read table overall;
read table rooms;
var assignment{CODE, ROOMS, DAYS, TIME} binary;
var room_assigned{CODE, ROOMS} binary;
i tried this code but it does not populate the excel
table result OUT "amplxl" "result.xlsx" "schedules":
[CODE, ROOMS, DAYS, TIME] , assignment;
write table result;
i also tried this code but get this error:
Abandoning compound command to accept declaration of result.
context: [CODE, ROOMS, DAYS, TIME] , >>> assignment; <<<
for {c in CODE, r in ROOMS, d in DAYS, t in TIME : assignment[c, r, d, t] = 1} {
table result OUT "amplxl" "result.xlsx" "schedules":
[CODE, ROOMS, DAYS, TIME] , assignment;
}
write table result;