Originally posted by: SystemAdmin
[Didier Vidal said:]
You have all the flexibility you want if you do the initialization with javascript statements, as in the following example
int a[1..2][1..2];
execute {
a[1][1] = 1;
a[1][2] = 2;
a[2][1] = 3;
a[2][2] = 4;
}
However, the constraint in this case is that the second dimension has the same indexer in all cases (your array must really be a matrix).
If you want to model structures that are more complex than a matrix, the best way is to use tuplesets. On the whitepaper page of OPL ([url=http://www.ilog.com/products/oplstudio/whitepapers/index.cfm]http://www.ilog.com/products/oplstudio/whitepapers/index.cfm[/url] ) you have an interesting whitepaper called "Efficient Modeling in ILOG OPL-CPLEX Development System" that details the use of tuplesets.
Didier Vidal
#DecisionOptimization#OPLusingCPLEXOptimizer