Hello Andrew !

It seems to an inconsistent behavior see example bellow, if display do not reference/instantiate model entities I would not expect any output for "display {(a,b) in S} (a,b);".

====

param Jm, default 3;
set J := 1..Jm;
set S, default {(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2)};

display Jm;
#printf "Jm = %d\n", Jm;

display J;
display Jm;

display S;
display {(a,b) in S} (a,b);

====

Output:

====

...

Display statement at line 7
Jm has empty content
Display statement at line 10
J:
   1
   2
   3
Display statement at line 11
Jm = 3
Display statement at line 13
S has empty content
Display statement at line 14
(0,0)
(1,0)
(2,0)
(0,1)
(1,1)
(2,1)
(0,2)

...

====

Cheers !

On 6/8/20 15:14, Andrew Makhorin wrote:
On Thu, 2020-08-06 at 14:50 +0200, Domingo Alvarez Duarte wrote:
Hello !

The printf command does show the default value when defined so
looking
through the code I think that this can be a fix for this issue:

https://github.com/mingodad/GLPK/commit/e54d6bbe41ba44c8fbecc3f9bc1c7
80acd78b118
Please see the document "Modeling Language GNU MathProg"
(glpk/doc/gmpl.pdf), Section 4.8 "Display statement".


Cheers !

On 6/8/20 13:59, Domingo Alvarez Duarte wrote:
Hello !

With the GMPL model below when we ask to display an entity with a
declared "default" value we get nothing but if we indirectly
reference
then  we get the "default" value.

====

param Jm, default 3;
set J := 1..Jm;

display Jm;
display J;
display Jm;
====

Output:

====

...

Display statement at line 3
Jm has empty content
Display statement at line 4
J:
    1
    2
    3
Display statement at line 5
Jm = 3
...

====

Cheers !



Reply via email to