IndexParameters and AllParameters have cardinality 0

28 views
Skip to first unread message

Wiet Mazairac

unread,
Apr 28, 2019, 6:02:21 PM4/28/19
to AIMMS - The Modeling System
Hi,

IndexParameters and AllParameters have cardinality 0.
However in the model I have lots of parameters.

If  run the next code...

put outf;
for (IndexIdentifiers) do
   
    statusmessage
(AllIdentifiers(IndexIdentifiers));
    statusmessage
(IdentifierType(IndexIdentifiers));
   
    put
AllIdentifiers(IndexIdentifiers);
    put
"  >  ";
    put
IndexIdentifiers;
    put
"  >  ";
    put
IdentifierType(IndexIdentifiers);

endfor
;
putclose
;

Part of the output is this ....


       
1.000  >  PD_Time       >  declaration
       
1.000  >  pd_tau        >  parameter
       
1.000  >  pd_dtpo       >  parameter
       
1.000  >  pd_tpo_card   >  parameter
       
1.000  >  pd_rdpo_card  >  parameter


And when I run this code ....
put outf;
for (IndexIdentifiers) do
   
    statusmessage
(AllIdentifiers(IndexIdentifiers));
    statusmessage
(IdentifierType(IndexIdentifiers));
   
    put
AllIdentifiers(IndexIdentifiers);
    put
"  >  ";
    put
IndexIdentifiers;
    put
"  >  ";
    put
IdentifierType(IndexIdentifiers);

endfor
;

put
"_____________\n";
put
"_____________\n";

put
Card(AllParameters);

putclose
;

The last few lines are these ....

       1.000  >  myGMPs        >  index
       
1.000  >  filen         >  index
       
1.000  >  foldern       >  index
       
1.000  >  test001       >  procedure   _____________
                                              _____________
                                                     
0.000

Why is Card(AllParameters) equal to zero while some identifiertypes are equal to parameter?



Mohan

unread,
May 2, 2019, 5:58:06 PM5/2/19
to AIMMS - The Modeling System
Hello Wiet,

What version of AIMMS are you using ?

I tested this statement in the latest version 4.65.1.0 and it is working correctly. Note that card(AllParameters) will also give you the count of all the system and predeclared parameters.

To get a count of parameters you declared in your model, you should declare a set as subset of AllParameters and a definition AllParameters * Main_YourProjectName.

Now, you will use put Card(SubsetofAllParameters)

Wiet Mazairac

unread,
May 6, 2019, 11:19:01 AM5/6/19
to AIMMS - The Modeling System
Hi,

I made a mistake here.
Somewhere I emptied AllParameters.

Related to that...
What is the right way to clear all data in the model?
Or to set all paramters to their default values?

WM

Wiet Mazairac

unread,
May 6, 2019, 11:19:01 AM5/6/19
to AIMMS - The Modeling System
Hi,

I use version 4.53.5.8.

What I forgot to tell.
If I open a new project and declare 1 parameter everything works as expected.
card(AllParameters) returns 175.

In the model I was talking about before the same statement returned 0.
Reply all
Reply to author
Forward
0 new messages