[Cmpl] Problem with "unexpected SYMBOL_VAR"
Steglich, Mike
steglich at th-wildau.de
Tue May 10 07:24:04 EDT 2016
Hi Poalo,
There is actually a problem with line name when a n-tuple is used in a loop.
This bug does not have an impact on the solution itself, it only produces
wrong line names. We discussed that issue a couple of weeks ago in the CMPL
mailing list.
I hope that I can fix it until the next release. In the meantime you could
use the following expression as a workaround:
{[w,s] in Arcs, i:=w, j:=s: cnst_3_$i$_$j$: b[w,s] + b[s,w] <= B*x[w,s]; }
Thanks,
Mike
Von: Paolo Grossi [mailto:smoldino at gmail.com]
Gesendet: Dienstag, 10. Mai 2016 10:26
An: Mike Steglich <mike.steglich at th-wildau.de>
Betreff: Re: [Cmpl] Problem with "unexpected SYMBOL_VAR"
Hi Mike,
With your help I'm glad to say: it's running!
We noticed just one curious behaviour, about last constraint:
# model.cmpl
cnst_3 {[w,s] in Arcs: b[w,s] + b[s,w] <= B*x[w,s]; }
###########
Given a reasonable istance to the solver, he gave us all the informations,
included these:
# $ cmpl model.cmpl
Constraints:
...
cnst_3[27003264] ... # Weird number!
...
###############################
So the point is: is it a signal of error or it cannot represent into the
square brackets the couple depicting an "Arc"?
Best Regards,
Paolo Grossi.
2016-05-07 11:26 GMT+02:00 Paolo Grossi <smoldino at gmail.com
<mailto:smoldino at gmail.com> >:
Yeah sounds reasonable!
This afternoon I will check. Usually I proved the model from a different
folder.
Thanks for the advices!
Regards,
Paolo Grossi.
2016-05-07 11:20 GMT+02:00 Mike Steglich <mike.steglich at th-wildau.de
<mailto:mike.steglich at th-wildau.de> >:
Hmmm...
Should work. I tested it also on Ubuntu (14.04 and 16.04). Sounds like a
unexpected problem with the cmpl script which is installed by default in
/usr/bin.
How did you start the model. (in the same folder ... or from a different
one).
Thanks,
Mike
Am 06.05.2016 um 22:17 schrieb Paolo Grossi <smoldino at gmail.com
<mailto:smoldino at gmail.com> >:
Ubuntu 15.04
Best regards,
Paolo Grossi.
Il 06/mag/2016 22:13, "Mike Steglich" <mike.steglich at th-wildau.de
<mailto:mike.steglich at th-wildau.de> > ha scritto:
Hello Paolo,
Which operating system do you use?
Thanks,
Mike
Am 06.05.2016 um 17:52 schrieb Paolo Grossi <smoldino at gmail.com
<mailto:smoldino at gmail.com> >:
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
<mailto: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
<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 <mailto: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.
_______________________________________________
Cmpl mailing list
Cmpl at list.coin-or.org <mailto:Cmpl at list.coin-or.org>
http://list.coin-or.org/mailman/listinfo/cmpl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cmpl/attachments/20160510/f7e99995/attachment.html>
More information about the Cmpl
mailing list