help-glpk
[Top][All Lists]

## Re: [Help-glpk] Having trouble specifying a constraint: syntax error in

 From: glpk xypron Subject: Re: [Help-glpk] Having trouble specifying a constraint: syntax error in literal set Date: Fri, 11 May 2012 17:57:50 +0200

```Hello Joel,

the error must be in another line. Have a look at your definitions of the sets.

The following model does not create a syntax error:

set Campaigns:= {1..5};
set D:= {1..31};
set P:= { "A", "B", "C"};
set CampProd, dimen 2 := { (1,"A"), (2,"B"), (3,"C"), (4,"A"), (5,"B") };
set ProdDay, dimen 2 := { ("A",5), ("B",4) };

var Q{P,D}, >= 0;
var B{Campaigns,D}, >= 0;

s.t. quant_consumed{(p,d) in ProdDay}: Q[p,d] <= 9999999 * sum{c in Campaigns:
(c,p) in CampProd} B[c,d];
end;

Best regards

Xypron

-------- Original-Nachricht --------
> Datum: Fri, 11 May 2012 08:19:51 +1000
> Betreff: [Help-glpk] Having trouble specifying a constraint: syntax error in
> literal set

>
> Hello,
> I'm quite new to GLPK and am having difficulty specifying a constraint.  I
> am modelling production at a furniture plant.  The following constraint is
> trying to constrain the quantity (Q) of products (p) entering the plant
> each day (d).  In order for products to enter the plant, it must be set up in
> a compatible campaign mode (c) which consumes that product {(c,p) in
> CampProd}.  B[c,d] is a binary variable that specifies whether a campaign will
> be run on a given day.
> The constraint produces a "syntax error in literal set" message:
> s.t. quant_consumed{(p,d) in ProdDay}: Q[p,d] <= 9999999 * sum{c in
> Campaigns: (c,p) in CampProd} B[c,d];
> Any help would be much appreciated.

--
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a

```