[Cmpl] Problem with "unexpected SYMBOL_VAR"

Steglich, Mike steglich at th-wildau.de
Fri May 6 07:47:28 EDT 2016


Hi Paolo,



Thank you for your interest in CMPL.



There is a mistake in your constraint. You used a parameter in the set 
pattern matching ({s in Arcs *> b [w,*] ) where only  a pattern is expected.

Please use:

csnt_2 {w in Nodes : sum{s in Arcs *> [w,*] : b[w,s]}

                   - sum{s in Arcs *> [*,w] : b[s,w]} = bal[w]; }



Cheers,



Mike



Von: Cmpl [mailto:cmpl-bounces at coin-or.org] Im Auftrag von Paolo Grossi
Gesendet: Freitag, 6. Mai 2016 11:44
An: cmpl at list.coin-or.org
Betreff: [Cmpl] Problem with "unexpected SYMBOL_VAR"



Good morning,

We are working on a University of Pisa project.

First of all, we are dealing with CMPL model.

So, thanks in advance for your help!



Using:

http://cmpl.th-wildau.de/cmpl-net.php



To try few very basic examples, like the following:



########################################



parameters:



Nodes := set(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);

bal[Nodes] := (-397.57, 136.639, 0, 137.667, 123.265, 0, 0, 0, 0, 0);

v[Nodes] := (9999999999, 200000, 200000, 200000, 200000, 200000, 200000, 
200000, 200000, 200000);

Arcs := set([1, 5], [3, 7], [4, 8], [2, 5], [6, 8], [9, 8], [0, 2], [0, 5],

            [5, 1], [7, 3], [8, 4], [5, 2], [8, 6], [8, 9], [2, 0], [5, 0]);

f[Arcs] := (42314, 22802.8, 58790.7, 11875.2, 93940, 58777.3, 114089, 
121121,

            42314, 22802.8, 58790.7, 11875.2, 93940, 58777.3, 114089, 
121121);

B := 100;

k := 4;



variables:



x[Nodes,Nodes] : binary;

o[Nodes]: binary;

b[Arcs] : real[0..B];



objectives:



costs: sum{[w,s] in Arcs: x[w,s]*f[w,s]} + sum{w in Nodes: o[w]*v[w]} -> 
min;



constraints:



csnt_1 {w in Nodes : sum{s in Nodes, s != w: x[w,s]} <= 2 + o[w]*(k-2); }

csnt_2 {w in Nodes : sum{s in Arcs *> b[w,*] : b[w,s]}

                   - sum{s in Arcs *> b[*,w] : b[s,w]} = bal[w]; }

csnt_3 {[w,s] in Arcs: b[w,s] + b[s,w] <= B*x[w,s]; }



########################################



We receive this error regarding the flow conservation constraints (named as 
"csnt_2"):



error (compiler): file clp-5574.cmpl line 26: syntax error, unexpected 
SYMBOL_VAR



Best regards,

Paolo Grossi.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cmpl/attachments/20160506/70d51f8d/attachment.html>


More information about the Cmpl mailing list