<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Michal,</div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Thank you for your interest in CMPL.</div><div><br></div><div>1) Tupel-sets</div><div>We think also that tupel-sets&nbsp;(multi-dimensional&nbsp;sets) &nbsp;are a "must have" of a mathematical programming language.&nbsp;</div><div>Therefore we are implementing tupel-sets and a new data file format at the moment. &nbsp;</div><div>Please download&nbsp;a CMPL presentation (INFORMS 2011) that gives you an impression about these new CMPL features (beginning at slide 12).</div><div></div></div><span><a href="http://www.coliop.org/download/cmplInforms2011.pdf">http://www.coliop.org/download/cmplInforms2011.pdf</a></span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div><br></div><div>I think (hope) that we will release this &nbsp;version in April/May.</div><div><br></div><div>Until the release of the new version you can use a workaround. &nbsp;The idea is to have a matrix that contains the valid combinations of indices and to use this matrix for the definition of the variables, objective function and the constraints.&nbsp;</div><div><br></div><div>For the transportation problem I have defined a matrix <i>r</i> for the valid routes between the sources <i>i</i> and the destinations <i>j</i>.&nbsp;</div><div><font class="Apple-style-span" face="'Courier New'">r[,] := ( (1,1), (1,2) , (1,4), (2,2), (2,3) , (2,4), (3,1) , (3,3) );</font></div><div>The elements of<i> r</i> are used for the definition of the variables<i> x[i,j].</i></div><div><span class="Apple-style-span" style="font-family: 'Courier New'; ">x[ r[i,1],r[i,2] ]&nbsp;</span></div><div>The entire problem can be formulated as follows:</div><div><span class="Apple-style-span" style="font-family: 'Courier New'; ">parameters:</span></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-tab-span" style="white-space: pre; ">        </span>plants &nbsp;:= 1(1)3;<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>centers := 1(1)4;<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>s[plants] &nbsp;:= (5000,6000,2500);<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>d[centers] := (6000,4000,2000,1500);<br><br><span class="Apple-tab-span" style="white-space: pre; ">        </span>c[plants,centers] := ( (3,2,7,6), (7,5,2,3),(2,5,4,5) );<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>#relevant routes<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>r[,] := ( (1,1), (1,2) , (1,4), (2,2), (2,3) , (2,4), (3,1) , (3,3) );<br><br>variables:<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>#definition of the vector x is based on the relevant routes in r[,]<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>{ i in defset(r[,1]) :&nbsp;<span class="Apple-tab-span" style="white-space: pre; ">        </span>x[ r[i,1],r[i,2] ]: real[0..]; }<br><br>objectives:<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>costs: sum{i in defset(r[,1]) : c[ r[i,1],r[i,2] ] * x[ r[i,1],r[i,2] ] } -&gt;min;<br><br>constraints:<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>#extended by a check whether a x[i,j] is a valid route<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>supplies {i in plants &nbsp;: sum{j in centers, count(x[i,j])&gt;0 : x[i,j] &nbsp;} &lt;= s[i];}<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>demands &nbsp;{j in centers : sum{i in plants, &nbsp;count(x[i,j])&gt;0 : x[i,j] &nbsp;} = &nbsp;d[j];}&nbsp;</font><br>&nbsp;</div><div>This is actually not a smart approach but it works.</div><div><br></div><div>2) You are right, in CMPL all entities are declared and initiated at the same moment.&nbsp;</div><div>I assume that you want to implement and test a model independently from the (real) data. &nbsp;</div><div>Our idea is to create and test a model with dummy data. The values of the sets and parameters can be read by using <i>include</i> or <i>readcsv</i>() (and later with the CMPL new data file format).&nbsp;</div><div>For solving a real problem you only have to exchange the dummy date file by your real data file. &nbsp;</div><div><br></div><div>3) GPL / EPL</div><div>This issue is (unfortunately) still under discussion. As you mentioned we have got some requests in this mailing list that I answered directly and not via the mailing list. I had also a discussion with Kipp Martin (COIN-OS).</div><div><br></div><div>We like the idea of "give and take" and we think that GPL is the best way to share software in this manner. &nbsp;But we see also the problem that GPL isn't compatible to EPL and to commercial licenses if the source code is&nbsp;to be shared. Therefore we are looking for approaches to avoid these problems. One alternative is to have a dual license (GPL or EPL). The second possibility is to grant an individual license to a specific project.&nbsp;</div><div><br></div><div>But this issue is only relevant&nbsp;if you want to share source code. &nbsp;If you only want to use CMPL as an external process (e.g. via Java ProcessBuilder) then you don' have any license problems. &nbsp;</div><div><br></div><div><br></div><div>Cheers</div><div><br></div><div>Mike</div><div><br></div><div><br></div><div><div><div>Am 02.02.2012 um 09:58 schrieb Michal Kaut:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello,<br><br>We are considering using CMPL (it looks very promising), but have a couple of<br>questions first:<br><br>1. Looking at the examples in the manual, I do not see any multi-dimensional<br>sets. For example, in the Transportation problem, if we did not have all-to-all<br>links, I would find it natural to define set 'links' being a subset of 'plants X<br>centers' and index 'c' on that set. The objective would then be<br> &nbsp;costs: sum{(i, j) in links : c[i,j] * x[i,j] } ­-&gt;min;<br>Is this possible in CMPL?<br>And if not, can I at least define c only on a subset of 'plants X centers'<br>(without giving the subset a name)?<br><br>2. As far as I can see, all entities are declared and initiated at once - does<br>it mean that it is not possible to declare an entity (for ex. to say that S is a<br>set), and give it values some time later?<br><br>3. I guess you do not like this question, since you did not respond to it<br>previously, but I try nevertheless: why GPL? Would you at least consider dual<br>licensing with CPL or EPL, to make it compatible with the other Coin-OR projects?<br><br><br>Thanks a lot in advance.<br><br>Regards,<br>Michal Kaut<br>_______________________________________________<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">http://list.coin-or.org/mailman/listinfo/cmpl</a><br></div></blockquote></div><br></div></div></div></div><br></body></html>