Closed hdavid16 closed 2 years ago
An easier alternative is to have disjunction specific disaggregation: tag the disjunction name to the disaggregated variables (check they don't already exist). This way you don't need to know the number of disjunctions before hand. Keep a record of the names of each disjunction that is added to ensure no duplicates.
This brings up another issue: constraints can't be used in more than one disjunction. Need to enforce this by keeping track of already reformulated constraints. However, you could use a reformulated constraint in a parent disjunct. So maybe a warning should be thrown stating the actual constraint that is being reformulated?
Binary variables can be modelled as a Matrix of binaries (2 indices: 1st index is the number of disjuncts, 2nd index is the number of disjunctions). A
SparseAxisArray
might be better suited for this since not all disjunctions have the same number of disjuncts.