[Cmpl] Problem with "unexpected SYMBOL_VAR"
Paolo Grossi
smoldino at gmail.com
Fri May 6 11:52:30 EDT 2016
Hi Mike,
Thanks for the reply. We finally solve the issue!
Now, we encountered another (hopefully simple) problem: once corrected the
model, we type:
$ cmpl model.cmpl
And this error arise:
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
CMPL model generation - running
CMPL version: 1.10.0
Authors: Thomas Schleiff, Mike Steglich
Distributed under the GPLv3
create model instance ...
error (input/output): Input file '...' not found
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Here is the files used:
##############################################################
# "model.cmpl" file:
%arg -ignoreZeros
%data capa1.cdat: Nodes set, Arcs set, bal[Nodes], v[Nodes], f[Arcs], B, k
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 *> [w,*] : b[w,s]}
- sum{s in Arcs *> [*,w] : b[s,w]} = bal[w]; }
csnt_3 {[w,s] in Arcs: b[w,s] + b[s,w] <= B*x[w,s]; }
##############################################################
# "capa1.cdat" file:
%B < 100 >
%k < 4 >
%Nodes set < 0..9 >
%bal[Nodes] < -476.839 0.000 139.719 67.831 95.974 0.000 78.311 95.003
0.000 0.000 >
%v[Nodes] < 999999999.000 30000.000 30000.000 30000.000 30000.000 30000.000
30000.000 30000.000 30000.000 30000.000 >
%Arcs set < [2, 5] [5, 2] [2, 9] [9, 2] [3, 1] [1, 3] [3, 5] [5, 3] [4, 1]
[1, 4] [4, 8] [8, 4] [6, 5] [5, 6] [6, 8] [8, 6] [7, 9] [9, 7] [0, 7] [7,
0] [0, 8] [8, 0] [0, 9] [9, 0] >
%f[Arcs] < 82637.019 82637.019 17510.392 17510.392 89383.160 89383.160
61211.663 61211.663 77508.079 77508.079 144847.452 144847.452 34701.566
34701.566 89441.529 89441.529 25329.612 25329.612 60420.973 60420.973
41172.695 41172.695 42579.814 42579.814 >
##############################################################
Thanks for taking the time to consider our email.
Paolo Grossi.
2016-05-06 13:47 GMT+02:00 Steglich, Mike <steglich at th-wildau.de>:
> 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/b8eb1b28/attachment.html>
More information about the Cmpl
mailing list