help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Syntax Error in Data section


From: Andrew Makhorin
Subject: Re: [Help-glpk] Syntax Error in Data section
Date: Mon, 09 May 2011 17:37:16 +0400

> 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:

Generating constraint1...
foo.mod:39: d[Mon,Mainshort] out of domain
MathProg model processing error

In your model d is declared as 

> param d{i in I, k in K};
> /* duration of room type i on day k */

and in the data section you specify:

> set I:= Mainshort Mainlong EOPSshort EOPSlong; # room type
>  
> set K:= Mon Tue Wed Thu Fri; # days of the week
>  
> 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;
>  

Thus, element d[Mainshort,Mon] exists while d[Mon,Mainshort], which
you refer in constraint1, doesn't.

Check indices!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]