Super slicing

AIMMS model identifiers, in particular the (decision) variables and constraints, but also parameters used in intermediate computations, are over declared over subsets, as the decision problem at hand typically only needs to/can be solved for a selection of the data. The design choice is here to declare identifiers with a minimal index domain such that they do not allow values outside what is expected.

The WebUI Table widget on the other hand expects the indices for the rows and for the columns to be the same for all identifiers displayed. AIMMS releases up to AIMMS 4.61 forced the model builder to reference only identifiers that are declared over sets that are the same or supersets of the ones used in the table widget. The design choice is here to declare identifiers with a maximal domain such that they can always be displayed in WebUI Table widgets. This is similar for other AIMMS data widgets such as the bar chart.

Super slicing, introduced in AIMMS 4.62, overcomes the friction between the design choices in the above two paragraphs. Let me explain via an example.

Consider a network where some nodes represent factories (set s_F, index i_F), some nodes represent distribution centers (set s_DC, index i_DC), and some nodes represent stores (set s_S, index i_S). In such a network, all locations (s_L, i_L) can have storage, but only some locations have production capacity, and only some locations have demand.

Assume, we’re working in the model, we’d prefer to declare the relevant parameters as follows:

 1Set s_L {
 2    Index: i_L;
 3    InitialData: data { a, b, c, d };
 4}
 5Set s_F {
 6    SubsetOf: s_L;
 7    Index: i_F;
 8    Definition: data { a };
 9}
10Set s_DC {
11    SubsetOf: s_L;
12    Index: i_DC;
13    Definition: data { b, c };
14}
15Set s_S {
16    SubsetOf: s_L;
17    Index: i_S;
18    Definition: data { d };
19}
20Parameter p_Lat {
21    IndexDomain: i_L;
22}
23Parameter p_Lon {
24    IndexDomain: i_L;
25}
26Parameter p_Storage {
27    IndexDomain: i_L;
28    InitialData: data { a : 10,  b : 11,  c : 12,  d : 13 };
29}
30Parameter p_ProductionCapacity {
31    IndexDomain: i_F;
32    InitialData: data { a : 10 };
33}
34Parameter p_Demand {
35    IndexDomain: i_S;
36    InitialData: data { d : 12 };
37}

The initial table widget specification:

../../_images/01InitialTableWidgetSpecification.PNG

after super slicing i_S to i_L via the display domain of p_Demand:

../../_images/02AfterSuperSlicingOnIndexI_S.PNG

after super slicing i_F to i_L via the display domain of p_ProductionCapacity:

../../_images/03AfterSuperSlicingOnIndexI_F.PNG

Note in the above, the cursor shows “forbidden” when hovering over the empty cells. This is expected, as these cells correspond to elements outside the domain of the corresponding identifiers.