WAG is not really one set, but rather an indexed collection of sets. To get the sum of the number of elements in all sets of the indexed collection, you could write, for example,
set W;
set WAG {W};
param p = sum {w in W} card(WAG[w]);
If instead you wanted the total number of different elements in all sets of the indexed collection, then you would need to define p like this:
param p = card (union {w in W} WAG[w]);
(In either case, in your data you will need
set W := W1 W2 W3 ;
followed by your data statements that give the members of WAG[W1], WAG[W2], and WAG[W1].)
--
Robert Fourer
am...@googlegroups.com