I have the following problem. I loop through a set, use this to define a new set and its complement, and inside the loop I call some parameters that depend on these sets. However, I can’t make these parameters to exclusively be defined over the sets. Here is an example below. What you see in the last couple of lines is:
---- 25 PARAMETER test1 set of j
A 1.000, B 1.000, C 1.000
---- 25 PARAMETER test2 set of not j
A 2.000, B 2.000, C 2.000
Instead I want to see something like this:
---- 25 PARAMETER test1 set of j
C 1.000
---- 25 PARAMETER test2 set of not j
A 2.000, B 2.000
Why are the test2 not in the complement set of test1? When I display the sets in the loop it looks like they are complementary, but then this does not hold for the parameters test1 and test2 any longer. Thanks for any help!
INPUT:
Sets
$onempty
k / A, B, C /
j(k) / /
notj(k) / /
;
Alias (k, kk) ;
Alias (j, jj) ;
Alias (notj, jnotj) ;
Parameters
test1 “set of j”
test2 “set of not j”
;
loop(kk,
j(kk)=yes;
notj(k)=not j(k);
display j, notj;
test1(j) = 1;
test2(notj) = 2;
display test1, test2;
j(kk)=no;
notj(k)=no;
display j, notj;
);
OUTPUT:
---- 22 SET j
A
---- 22 SET notj
B, C
---- 25 PARAMETER test1 set of j
A 1.000
---- 25 PARAMETER test2 set of not j
B 2.000, C 2.000
---- 28 SET j
( EMPTY )
---- 28 SET notj
( EMPTY )
---- 22 SET j
B
---- 22 SET notj
A, C
---- 25 PARAMETER test1 set of j
A 1.000, B 1.000
---- 25 PARAMETER test2 set of not j
A 2.000, B 2.000, C 2.000
---- 28 SET j
( EMPTY )
---- 28 SET notj
( EMPTY )
---- 22 SET j
C
---- 22 SET notj
A, B
---- 25 PARAMETER test1 set of j
A 1.000, B 1.000, C 1.000
---- 25 PARAMETER test2 set of not j
A 2.000, B 2.000, C 2.000
---- 28 SET j
( EMPTY )
---- 28 SET notj
( EMPTY )