===================================================================== *** Limited Data Checking on Tables in Optimization [Dec 2013] *** *** Internal Design Notes / Phil, 12-18-2013 (Draft) *** ===================================================================== NOTE: This has been superceded by this revision: http://cadswes2.colorado.edu/~philw/2013/Opt/LimitTableCheck/notes2.txt ------------------------------------------------------------------ (1) Support for "Optimization Min/Max" values on TableSlot Columns ------------------------------------------------------------------ The design document (of 11-21-2013) specifies the utilization of existing (and probably unused) TableSlot column minimum and maximum fields for representing "Optimization Min/Max" values. In discussion, Patrick, Tim and Phil agreed that it would probably be better to introduce new fields for this special use. The new Optimization Min/Max values have a use and meaning quite different from what those fields are used for on SeriesSlots. Although the new "Optimization Min/Max" fields will, in practice, apply to only TableSlot columns designated as the "X" and "Z" columns, encoding those limits as such may unnecessarily complicate the implementation of supporting modules (e.g. the multiple-slot "Configure Existing Slots" dialog). I propose that column-indexed vectors be added for these new min/max values: QVector _columnOptMinimums; // NaN values: no limit in column. QVector _columnOptMaximums; // NaN values: no limit in column. Both column index based accessors AND 'X' and 'Z' column accessors would be supported (with support discussed in the subsequent section). double columnOptMin (int col) const; double columnOptMax (int col) const; void setColumnOptMin (int col, double); void setColumnOptMax (int col, double); double xOptMin() const; double xOptMax() const; double zOptMin() const; double zOptMax() const; ------------------------------------------------------- (2) Adding X,Y,Z column index indications to TableSlot. ------------------------------------------------------- Various GUI provisions will need to know which TableSlot columns support "Optimization Min" and "Optimization Max" values. (And there would be benefit to knowing this in terms of which variables ("X" or "Z") are associated with those columns). Perhaps TableSlotProxy isn't the right place to add these fields. See, for example, method: void Reservoir::setupPrototype(). It contains calls to TableSlot methods, like this. regulatedSpillTable->setUnitType_bycol(LENGTH, 0); regulatedSpillTable->setUnitType_bycol(FLOW, 1); (Note that 'regulatedSpillTable' IS a TableSlotProxy. Its 'operator->' yields a mutable TableSlot instance). In a similar way, the indicies of the optionally designated 'X' 'Y' and 'Z' columns could be encoded like this: regulatedSpillTable->setXcolIndex(0); regulatedSpillTable->setYcolIndex(1); TableSlot would have these new fields: int _xColIndex; // default (-1) int _yColIndex; // default (-1) int _zColIndex; // default (-1) TableSlot accessors. (The setters would be used in, for example, method Reservoir::setupPrototype() as indicated above): int xColIndex() const { return _xColIndex; } // (-1): not supported int yColIndex() const { return _yColIndex; } // (-1): not supported int zColIndex() const { return _zColIndex; } // (-1): not supported void setXcolIndex (int); void setYcolIndex (int); void setZcolIndex (int); ------------------------------------------------------------------- (3) QUESTION: Criteria for Opt Min/Max support on TableSlot columns ------------------------------------------------------------------- WILL IT be reasonable to assume that TableSlot columns associated with an 'X' or 'Z' value SUPPORTS Opt Min/Max values? IF NOT, additional configuration data will be required -- possibly boolean flags: bool _xColSupportsOptMinMax; bool _zColSupportsOptMinMax; In this case, the setters mentioned above could have optional parameters: void setXcolIndex (int, bool supportsOptMinMax=false); void setZcolIndex (int, bool supportsOptMinMax=false); ----------------------------------------------------------------- (4) Effected Modules/Tasks: Setting up Data Model and GUI Support ----------------------------------------------------------------- (1) TableSlot data fields (discussed above). (2) TableSlot, new data field persistence (Tcl serialization). (3) DMI support for the column optimization min/max values. (4) GUI: TableSlot config dialog: when the selected column corresponds to the TableSlot's 'X' or 'Z' column, new entry fields for "Optimization Min" and "Optimization Max" are provided. (5) GUI: multiple-slot "Configure Existing Slots" dialog: when all of the slot/column list items are 'X' or 'Z' columns (on TableSlots), a new "Optimization Minimum and Maximum Values" section is enabled and available for use. This will be similar to the existing section for "Minimum and Maximum Values". ---