<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Anna,<div><br></div><div>First of all .. please use CMPL 1.10 because in CMPL 1.9 is a bug for the CBC option handling. </div><div><br></div><div>To set a solver option you can specify a CMPL header option for the solvers:</div><div><br></div><div><b>%opt </b><i>solverName</i> <i>solverOption</i> [<i>solverOptionValue</i>]</div><div><br></div><div>I've included selected CBC options in chapter 6.1 of the manual.</div><div><br></div><div>Cheers,</div><div><br></div><div>Mike <br><br></div><div><br><div><div>Am 02.07.2014 um 12:22 schrieb Anna Tarantini <<a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a>>:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div class="hmmessage"><div dir="ltr"><div>Hello Mike,</div><div>we'd like to ask you a few more things about the usage of CMPL, and in particular how we can manage the solver options.</div><div>We didn't find anything on the web so we need to bother you one last time.</div><div><br></div><div>We'd need to know how to force CBC to use the Primal or the Barrier instead of the Dual (which is default if i remember correctly) </div><div>and how we can tell the solver to use some cuts more than others and how frequently and, why not, how to disable some of them.</div><div><br></div><div>We truly appreciate the kindness you've shown us and we thank you in advance for the answer to this.</div><div>Greetings.</div><div><br></div><div>Anna</div><br><div><hr id="stopSpelling">From: <a href="mailto:mike.steglich@th-wildau.de">mike.steglich@th-wildau.de</a><br>Subject: Re: [Cmpl] some CMPL errors<br>Date: Tue, 17 Jun 2014 13:07:57 +0200<br>To: <a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a><br><br>Hu Anna,<br>
<br><div><div>Am 16.06.2014 um 11:44 schrieb Anna Tarantini <<a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a>>:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage" style="font-size:12pt;font-family:Calibri;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div dir="ltr">Hello Mike,<div>first of all WE DID IT!!!! thanks to you mostly.</div></div></div></blockquote>Great!!<br><blockquote><div class="ecxhmmessage" style="font-size:12pt;font-family:Calibri;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div dir="ltr"><div><br></div><div>But now we have to bother you again. </div><div>We'd like to know if there is a way to print the log of the solving execution in a file.</div><div>We have looked around to see if we could find something but no luck.</div><div>Can you help us with that?</div></div></div></blockquote><div>I can suppose two ways. If you work with Coliop then you can mark the CMP and solver output in the message panel in CMPL with Ctrl+A, copy it with CTRL+C and paste it into a text file with CTRL+V.</div><div><br></div><div>If you use the Cmpl binary then you can redirect the stdOut of CMPL and the solver in a text file with the following command:</div><div><br></div><div>cmpl yourFile.cmpl >output.txt. </div><div><br></div><div>Cheers,</div><div><br></div><div>Mike</div><div><br></div><div><br></div><br><blockquote><div class="ecxhmmessage" style="font-size:12pt;font-family:Calibri;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div dir="ltr"><div><br></div><div>Thank you very much again.</div><div>Greetings</div><div><br></div><div> Anna<br><br><div><hr id="ecxstopSpelling">From:<span class="ecxApple-converted-space"> </span><a href="mailto:mike.steglich@th-wildau.de">mike.steglich@th-wildau.de</a><br>Subject: Re: [Cmpl] some CMPL errors<br>Date: Wed, 21 May 2014 09:56:21 +0200<br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a><br><br>Hi Anna,<div><br></div><div><br><div><div>Am 19.05.2014 um 09:59 schrieb Anna Tarantini <<a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a>>:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage"><div dir="ltr">Hello Professor Steglich, </div></div></blockquote>(just Mike ;-))<br><blockquote><div class="ecxhmmessage"><div dir="ltr">Sorry to bother you one last time but we almost made it.</div></div></blockquote><div><br></div><div>Don't worry. You can ask whatever and whenever you want.</div><br><blockquote><div class="ecxhmmessage"><div dir="ltr"><div>We get one last error about an unexpected SYMBOL_VAR (expecting ':') in the following line:</div><div><br></div></div></div></blockquote><blockquote><div class="ecxhmmessage"><div dir="ltr">hubflow { j in NOHUBNODES : sum { x[j, hub] - x[hub, j] } = - sum{ dist[j] * beta }; }</div></div></blockquote><div><br></div><div>The sum expression within the loop contains not a index definition. I would like to propose two alternatives:</div><div><br></div><div><i>hubflow { j in NOHUBNODES : x[j, hub] - x[hub, j] = - dist[j] * beta ; }</i></div><div>This is the CMPL statement for x_j_hub - x_hub_j = - dist_j * beta ; for all j in NOHUBNODES</div><div><br></div><div>or </div><div><br></div><div><i>hubflow: sum{ j in NOHUBNODES : x[j, hub] - x[hub, j] } = - sum{ j in NOHUBNODES : dist[j] * beta }; </i></div><div>equivalent for sum_over_j_in_HUBNOTES x_j_hub - x_hub_j = - sum_over_j_in_HUBNOTES - dist_j * beta</div><div><br></div><div><br></div><div>I'm not sure which constraint fits your model.</div><div><br></div><div>Cheers,</div><div>Mike</div><div><br></div><div><br></div><div><br></div><br><blockquote><div class="ecxhmmessage"><div dir="ltr"><div><br></div><div>Thank you very much for your time and sorry again.</div><div><br></div><div>Greetings,</div><div><br></div><div>Anna<br><br><div><hr id="ecxstopSpelling">Subject: Re: [Cmpl] some CMPL errors<br>From:<span class="ecxApple-converted-space"> </span><a href="mailto:mike.steglich@th-wildau.de">mike.steglich@th-wildau.de</a><br>Date: Sun, 18 May 2014 13:55:23 +0200<br>CC:<span class="ecxApple-converted-space"> </span><a href="mailto:cmpl@list.coin-or.org">cmpl@list.coin-or.org</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a><br><br>Hi Anna,<div><br></div><div>If there is a loop fixing the index j you can use the fixed j also for the inner sum loops:</div><div><br></div><div><div class="ecxhmmessage"><div dir="ltr"><div class="ecxhmmessage"><div dir="ltr">flow { j in NOHUBNODES : sum{ i in NODES : x[j,i] } - sum{ i in NODES : x[i,j] } = dist[j] * beta; } </div><div dir="ltr"><br></div><div dir="ltr">or in short form if both sums uses actually the same set :</div><div dir="ltr"><br></div><div dir="ltr">flow { j in NOHUBNODES : sum{ i in NODES : x[j,i] - x[i,j] } = dist[j] * beta; } </div></div></div></div></div><div><br></div><div><br></div><div>Cheers, </div><div><br></div><div>Mike</div><div><br></div><div><br><div><div>Am 16.05.2014 um 16:36 schrieb Anna Tarantini <<a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a>>:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage"><div dir="ltr">Hello Professor Steglich,<div>Thank you for your answer.<br><div>This is our mathematical model.</div><div><br></div><div><br></div><div><div>Thank you very much for your time.</div><div>Greetings</div><div>Anna </div></div><div><br><div><hr id="ecxstopSpelling">Subject: Re: [Cmpl] some CMPL errors<br>From:<span class="ecxApple-converted-space"> </span><a href="mailto:mike.steglich@stegger.net">mike.steglich@stegger.net</a><br>Date: Tue, 13 May 2014 09:57:04 +0200<br>CC:<span class="ecxApple-converted-space"> </span><a href="mailto:cmpl@list.coin-or.org">cmpl@list.coin-or.org</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a><br><br>Hi Anna,<div><br></div><div>The first error is easy to solve:</div><div><br></div><div>Please write </div><div>cost: sum{<b>j in NODES</b>, i in 1..(j-1): y[i,j]* f + alfa * dist[i,j] * w[i,j] } -> min;</div><div><div><br></div>instead of:</div><div><div class="ecxhmmessage"><div dir="ltr">cost: sum{j in<span class="ecxApple-converted-space"> </span><b>1..NODES</b>, i in 1..(j-1): y[i,j]* f + alfa * dist[i,j] * w[i,j] } -> min;</div></div><div><br></div><div>The problem for the flow and hubFlow constraints is that you use the same index in the outer loop and in the inner sum loops.</div><div>flow {<b><span class="ecxApple-converted-space"> </span>j in NOHUBNODES</b><span class="ecxApple-converted-space"> </span>: sum{<b><span class="ecxApple-converted-space"> </span>j in NODES</b>, i in NODES : x[j,i] } - sum{ i in NODES,<b><span class="ecxApple-converted-space"> </span>j in NODES</b><span class="ecxApple-converted-space"> </span>: x[i,j] } = dist[j] * beta; }</div><div><br></div><div>Can you send a mathematical description for a better understanding? </div><div><br></div><div>Thanks,</div><div><br></div><div>Mike</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div><div>Am 12.05.2014 um 17:38 schrieb Anna Tarantini <<a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a>>:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage"><div dir="ltr">Hello Professor Steglich. <div>Thank you for your answer. I've tried to modify my model in order to make him functional but I still get some errors. Firstly now I use an instance in which I retrieve my parameters and then I still get the last two errors. I can easily explain all of this pasting you the code so here it is:<div><br></div><div><b>prova.cmpl</b></div><div><br></div><div><div>%arg -ignoreZeros</div><div><br></div><div><br></div><div>parameters:</div><div><br></div><div>include "istanza0.cmpl"</div><div><br></div><div><br></div><div>variables:</div><div><br></div><div>w[NODES, NODES]: integer[0..];</div><div><br></div><div>y[NODES, NODES]: integer[0..1];</div><div><br></div><div>x[NODES, NODES]: integer[0..];</div><div><br></div><div><br></div><div>objectives:</div><div><br></div><div>cost: sum{j in 1..NODES, i in 1..(j-1): y[i,j]* f + alfa * dist[i,j] * w[i,j] } -> min;</div><div><br></div><div><br></div><div>constraints:</div><div><br></div><div>strands { i in NODES, j in NODES : w[i,j] <= k * y[i,j]; }</div><div><br></div><div>flow { j in NOHUBNODES : sum{ j in NODES, i in NODES : x[j,i] } - sum{ i in NODES, j in NODES : x[i,j] } = dist[j] * beta; }</div><div><br></div><div>hubFlow { j in NOHUBNODES : sum{ j in NODES : x[j, hub] } - sum{ j in NODES : x[hub,j] } = - sum{ j in NOHUBNODES : dist[j] * beta }; }</div><div><br></div><div>capacity { i in NODES, j in NODES : x[j,i] + x[i,j] <= w[i,j] * omega; }</div><div><br></div><div><b>istanza0.cmpl</b></div><div><br></div><div><div>NODES := 1..12;</div><div>NOHUBNODES := 1..11;</div><div>hub := 12;</div><div><br></div><div>LINKS := 1..15;</div><div><br></div><div>k := 9;</div><div><br></div><div>links[LINKS, 1(1)3] := ((1, 2, 124.42),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (2, 5, 6887.90),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (2, 6, 84.81),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (2, 12, 944.68),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (3, 6, 162.52),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (3, 9, 1518.29),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (4, 7, 935.30),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (4, 10, 1898.83),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (4, 11, 1945.26),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (5, 7, 161.04),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (5, 8, 2530.56),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (6, 7, 1160.86),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (8, 10, 459.26),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (9, 12, 344.35),</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> (10, 11, 604.96));</div><div><br></div><div>alfa := 133;</div><div><br></div><div>f := 1081;</div><div><br></div><div>beta := 20;</div><div><br></div><div>omega := 7;</div><div><br></div><div>dist[NODES] := (591, 901, 260, 1147, 745, 1516, 1573, 1028, 2196, 903, 505, 0);</div><div><br></div></div><div><br></div><div><span style="font-size:12pt;"><b>And finally here are the errors:</b></span></div><div><br></div><div>error(compiler): file prova.cmpl line 20: A set can contain only integer and strings, but no other sets</div><div><div>error(compiler): file prova.cmpl line 27: syntax error, unexpected ASSIGN_ITER, expecting ':'</div><div>error(compiler): file prova.cmpl line 29: syntax error, unexpected ASSIGN_ITER, expecting ':'</div>error(compiler): file prova.cmpl line 29: syntax error, unexpected '}', expecting end of file</div><div><br></div><div>Thank you very much for your time.</div><div>Greetings</div><div>Anna </div><br><div><hr id="ecxstopSpelling">Subject: Re: [Cmpl] some CMPL errors<br>From:<span class="ecxApple-converted-space"> </span><a href="mailto:mike.steglich@stegger.net">mike.steglich@stegger.net</a><br>Date: Mon, 5 May 2014 17:30:30 +0200<br>CC:<span class="ecxApple-converted-space"> </span><a href="mailto:cmpl@list.coin-or.org">cmpl@list.coin-or.org</a>;<span class="ecxApple-converted-space"> </span><a href="mailto:t.schleiff@gmail.com">t.schleiff@gmail.com</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a><br><br>Hi Anna,<div><br></div><div>I apologize the very delayed answer. There was obesely a misunderstanding between me and Thomas (my teammate) who shout answer you.</div><div> Please see my answers below:</div><div> <br><div><div>Am 30.04.2014 um 17:24 schrieb Anna Tarantini <<a href="mailto:anna.tarantini@hotmail.it">anna.tarantini@hotmail.it</a>>:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage"><div dir="ltr">Hi, we're trying to formulate a simple model to get the layout of a MAN. <div>While compiling the CMPL we get some errors:</div><div><br></div><div>error(compiler): file prova.cmpl line 55: syntax error, unexpected SYMBOL_VAR</div><div>error(compiler): file prova.cmpl line 64: syntax error, unexpected ASSIGN_ITER, expecting ':'</div>error(compiler): file prova.cmpl line 64: syntax error, unexpected '}', expecting end of file<div><br></div><div>here's the CMPL file </div><div><br></div><div><div><br></div><div><br></div><div>%arg -ignoreZeros</div><div><br></div><div><br></div><div><br></div><div>parameters:</div><div><br></div><div>f:=30;</div><div>alfa:=40;</div><div>r:=(1,2,3,4,5);</div><div>beta:=20;</div><div>omega:=10;</div><div><br></div><div>seed:=srand(100);</div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span>M:=10000;</div><div><br></div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span>nrOfCities:=5;</div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span>NODES:=1..nrOfCities;</div><div><br></div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span>{i in NODES:</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> xp[i]:=rand(100);</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span><span class="ecxApple-converted-space"> </span> yp[i]:=rand(100);</div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span>}</div><div><br></div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span>{i in NODES, j in NODES:</div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span><span class="ecxApple-converted-space"> </span> {i==j: </div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span>dist[i,j]:=M; |</div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span><span class="ecxApple-converted-space"> </span> default: </div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span>dist[i,j]:= sqrt( (xp[i]-xp[j])^2 + (yp[i]-yp[j])^2 );</div><div><span class="ecxApple-tab-span" style="white-space:pre;">                </span>dist[j,i]:= dist[i,j]+rand(10)-rand(10);</div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span><span class="ecxApple-converted-space"> </span> }</div><div><span class="ecxApple-tab-span" style="white-space:pre;">        </span>}</div><div><br></div><div><br></div><div>#include "istanza0.cmpl"</div><div><br></div><div><br></div><div>variables:</div><div><br></div><div><br></div><div><br></div><div>w[NODES, NODES]: integer[0..];</div><div><br></div><div>y[NODES, NODES]: integer[0..1];</div><div><br></div><div>x[NODES, NODES]: integer[0..];</div><div><br></div><div><br></div><div><br></div><div>objectives:</div><div><br></div><div><br></div><div><br></div><div>cost: (sum{j:=1..nrOfCities : sum{i:=1..(j-1): y[i,j] }} * f) +</div><div> </div><div> (alfa * sum{j:=1..nrOfCities: sum{i:=1..(j-1): d[i,j] * w[i,j] }}) -> min;</div></div></div></div></blockquote><div><br></div><div>The parameter array<span class="ecxApple-converted-space"> </span><i>d[,]<span class="ecxApple-converted-space"> </span></i>is not defined. I would assume that you want to use<span class="ecxApple-converted-space"> </span><i>dist[,]</i>. You can additionally simplify your objective function because the two sums run over the same sets.</div><div><br></div><div>This is my proposal:</div><div><br><i>cost: sum{j in 1..nrOfCities, i in 1..(j-1): y[i,j]* f + alfa * dist[i,j] * w[i,j] } -> min;</i></div><div><br></div><div><br></div><br><blockquote><div class="ecxhmmessage"><div dir="ltr"><div><br></div><div><br></div><div><br></div><div><br></div><div>constraints:</div><div><br></div><div>strands { i in NODES, j in NODES : w[i,j] <= k * y[i,j]; }</div></div></div></blockquote><div><br></div><div><i>k<span class="ecxApple-converted-space"> </span></i>is not defined.</div><div><br></div><div><br></div><br><blockquote><div class="ecxhmmessage"><div dir="ltr"><div><br></div><div>flow { j in NODES-1 : sum{ j in NODES, i in NODES : x[j,i] } - sum{ i in NODES, j in NODES : x[i,j] } = r[j] * beta; }</div></div></div></blockquote><br><blockquote><div class="ecxhmmessage"><div dir="ltr">hubFlow { j in NODES-1 : sum{ j in NODES : x[j, NODES] } - sum{ j in NODES : x[NODES,j] } = - sum{ j in NODES-1 : r[j] * beta }; }</div></div></blockquote><div><br></div><div>This is a little bit more difficult to answer:</div><div>Do you want really to use the index<span class="ecxApple-converted-space"> </span><i>j</i><span class="ecxApple-converted-space"> </span>in the outer and the inner sums? If not please use another index for the outer sum. Do you mean<span class="ecxApple-converted-space"> </span><i>j in (1..nrOfCities-1)</i><span class="ecxApple-converted-space"> </span> instead<span class="ecxApple-converted-space"> </span><i>j in NODES-1</i>. In my mind does make <i>NODES-1</i><span class="ecxApple-converted-space"> </span>not really sense. </div><div><br></div><div><div class="ecxhmmessage"><div dir="ltr">I do not understand the idea of<i><span class="ecxApple-converted-space"> </span> x[j, NODES].<span class="ecxApple-converted-space"> </span></i> Do you want to address a single element of the array<span class="ecxApple-converted-space"> </span><i>x[,]<span class="ecxApple-converted-space"> </span></i>or the vector out of the matrix<i><span class="ecxApple-converted-space"> </span>x[,]</i>?</div></div></div><div> </div><div><br></div><blockquote><div class="ecxhmmessage"><div dir="ltr"><div><div><br></div><div>capacity { i in NODES, j in NODES : x[j,i] + x[i,j] <= w[i,j] * omega; }</div><div><br></div><div><br></div><div><br></div><div>Any clue of how to resolve those errors?</div></div><div>Greetings</div><div><br></div></div></div></blockquote><div><br></div><div>Thanks,</div><div><br></div><div>Mike</div><div><br></div><div><br></div><div><br></div><br><blockquote><div class="ecxhmmessage"><div dir="ltr">Anna</div></div>_______________________________________________<br>Cmpl mailing list<br><a href="mailto:Cmpl@list.coin-or.org">Cmpl@list.coin-or.org</a><br><a href="http://list.coin-or.org/mailman/listinfo/cmpl" target="_blank">http://list.coin-or.org/mailman/listinfo/cmpl</a></blockquote></div><br></div></div></div></div></div></div></blockquote></div><br></div></div></div></div></div></div></div><span><modIng.pdf></span></blockquote></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></blockquote></div><br></div>                                            </div></div>
</blockquote></div><br></div></body></html>