[Cmpl] Question on line names

Mike Steglich mike.steglich at stegger.net
Fri Apr 1 12:27:50 EDT 2016


Hi Maria,

Could you send your model directly to me? (mike.steglich at th-wildau.de <mailto:mike.steglich at th-wildau.de>)

The Cmpl expressions you sent should work as you expect. It could be possible that you found a bug.

Thanks,

Mike

> Am 01.04.2016 um 18:03 schrieb Maria Giatsoglou <maria.giatsoglou at gmail.com>:
> 
> Hello, 
> 
> I have a question regarding the approach followed for line naming in loops that iterate over sets of 2-tuples.
> To clarify the issue I attach the following example:
> 
> In my cmpl file I have the following constraint generation loop:
> 
> 
> test_line_name {len(A) > 0 : {[i,j] in A: 
>  echo i; echo j;
>  sum{k in (A_B *> [i,*]): x[i,k] * B[k]} - sum{k in (A_B *> [j,*]): x[j,k] * B[k]}  <= C[i,j];
>  sum{k in (A_B *> [j,*]): x[j,k] * B[k]} - sum{k in (A_B *> [i,*]): x[i,k] * B[k]}  >= D[i,j];
> }
> 
> In the above, A and A_B are instances of set[2] used as parameters, C and D are again parameters defined over A (i.e. C[A] and D[A]), B is another array of parameters defined over a set of values, and x defined over A_B (i.e. x[A_B]) represents the problem variables. All values are provided though jCMPL.
> 
> 
> When I run the optimizer and print the solution report, I get strange values for the line names... For example, in the case of a tuple ["p","r"] the line names generated for the two constraints are  "test_line_name (38985568,1)" and   "test_line_name (38985568,2)" (whereas values "p" and "r" are printed correctly with the echo statements inside the loop).  
> 
> What does this numeric value of 38985568 corresponds to?
> I need to have a mapping between the type of constraint (as defined by me) and the parameters that populate it (i and j in my example), so that I can use it at a later phase in my project in case of a conflict.
> 
> I have also tried to transform the above formulation into double loops, as below, but the problem persists although now I get line names of the form " test_line_name (~1073741828,~1073741830,1)".
> 
> test_line_name {i in (A*> [*,/]):{j in (A*> [i,*]): 
> 
> sum{k in (A_B *> [j,*]): x[j,k] * B[k]} - sum{k in (A_B *> [i,*]): x[i,k] * [k]} <= C[i,j];	
> sum{k in (A_B *> [i,*]): x[i,k] * B[k]} - sum{k in (A_B *> [j,*]): x[j,k] * B[k]} >= D[i,j];
> }}
> 
> I also noticed that inside the loop I can use an expression such as: 
> 
> test_line_name_$i$: sum{k in (A_B *> [j,*]): x[j,k] * B[k]} - sum{k in (A_B *> [i,*]): x[i,k] * [k]} <= C[i,j];
> 
> which correctly prints the line name using the value of i, but the expression 
> 
> test_line_name_$i$_$j$: sum{k in (A_B *> [j,*]): x[j,k] * B[k]} - sum{k in (A_B *> [i,*]): x[i,k] * [k]} <= C[i,j];
> 
> does not work, since only one variable is supported.
> 
> Any ideas / suggestions on how to approach this issue are more than welcome!
> 
> Thank you very much in advance,
> Maria 
> 
> _______________________________________________
> Cmpl mailing list
> 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/20160401/9a60d353/attachment.html>


More information about the Cmpl mailing list