I try to define set of set in OPL. The problem is:
set COMPPLATFORMS;
set CONFCP{COMPPLATFORMS}
param vcpu {d in COMPPLATFORMS, CONFCP[d]};
However, in OPL we do not have a straightforward way of declaring an indexed set. I notice that we could use either tuple or maybe some preprocessing. But now I am not sure how to declare the parameter "vcpu" for the indexed set?
I know that we could have an array of sets, or sets of array. But could we have a set of set?
Is there any example in OPL that follow the similar structure? Thank you
See sets of sets in the example power sets in how to with OPL
{string} s={"A","B","C","D"};
range r=1.. ftoi(pow(2,card(s)));
{string} s2 [k in r] = {i | i in s: ((k div (ftoi(pow(2,(ord(s,i))))) mod 2) == 1)};
execute
{
writeln(s2);
}