Hi I am doing a project for uni and have written out everything but when I  
run the program in GLPK it comes up with syntax error in data section  
highlighting the data in the last table param d. This is what I have:

#
# Optimal Allocation of Operating Theatres
#
#
 
set I;
/* room type*/
 
set J;
/* department */
 
set K;
/* day 
 
param u{j in J};
/* maximum number of underallocated hours in department  j */
 
param h{j in J};
/* target hours for department j */
 
param a{i in I, k in K};
/* number of room type i available on day k  */
 
param d{i in I, k in K};
/* duration of room type i on day k */
 
var x{i in I, j in J, k in K} >=0, integer;
/* number of rooms of  type i assisgned to department j on day k */
 
var sm{j in J} >=0;
/* underallocation of hours */
 
var sp{j in J} >=0;
/*overallocation of hours */
 
maximize z: sum{i in I, j in J, k in K} x[i,j,k];
/* total allocation  */
 
constraint1{j in J}: sum{i in I, k in K} d[i,j] * x[i,j,k] + sm[j] - sp[j]  
= h[j]; 
/* target hours */
 
constraint2{i in I, k in K}: sum{j in J} x[i,j,k] <= a[i,k];
/*  number of rooms per day */
 
data;
 
set I:= Mainshort Mainlong EOPSshort EOPSlong; # room type
 
set J:= Surgery Gynaecology Opthamology Oralsurgery Otolaryngology  
Emergency; # department
 
set K:= Mon Tue Wed Thu Fri; # days of the week
 
param h := Surgery 179
Gynaecology 107.4
Opthamology  29.4
Oralsurgery 9.9
Otolaryngology 16.3 
Emergency 2.4;
 
param a: Mainshort Mainlong EOPSshort EOPSlong := 
Mon 4 4 1 1
Tue 4  4 1 1
Wed 4 4 1 1
Thu 4 4 1 1
Fri 4 4 1 1;
 
param d: Mainshort Mainlong EOPSshort EOPSlong := 
Mon 7.5 9 7.5  8
Tue 7.5 9 7.5 8
Wed 7.5 9 7.5 8
Thu 7.5 9 7.5 8
Fri 7.5 9 7.5  8;
 
The table is an identical format to the one above it param a and I can't  
see for the life of me what the syntax error could be. Can you help?  Thanks
 
Lizzy
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to