Limited Data Checking on Tables in Optimization: Data Model, GUI and DMI Support

Document: R:\doc\optimization\LimitDataChecking-DataSupport.docx
Document: R:\doc\optimization\LimitDataChecking-DataSupport-2014-01-08.pdf
Document: http://cadswes2.colorado.edu/~philw/2013/Opt/LimitTableCheck/Bake1.html
  Initial writing: 1-7-2014; Edit: 1-8-2014 (Phil Weinstein, CADSWES)
See also: R:\doc\optimization\OptTableCheckingRangesFRD.fm [Tim Magee, CADSWES, 11-15-2013]

Enhancements were made to RiverWare 6.5 development to support optimization data checking limits for TableSlot columns. This includes:

  1. New association between "X" "Y" "Z" optimization variables and particular TableSlot columns.
  2. New TableSlot column attributes indicating whether "optimization limits" are supported.
  3. New TableSlot column optimization limit numeric attributes: optimization min and max.
  4. GUI support for editing Table Slot column optimization min and max values:
    1. TableSlot column configuration dialog
    2. Multiple slot configuration dialog.
    3. New GUS slot filter (RootFilter): "Supports Opt Limits"
  5. Control File/Exec-based DMI enhancements: New data file records supporting one value per column:
    1. "scale"
    2. "unit"
    3. "opt_min"
    4. "opt_max"

The current development does not include modifications to the Optimization TableSlot data checking algorithms, i.e. to limit the scope of such checks to user-specified optimization minima and maxima. Also, only a demonstration sample of TableSlot configurations were modified to make use of the new optimization limits. See the next section.

Contents:

This document contains the following sections:

  1. New TableSlot Configurations / Development Examples
  2. TableSlot column configuration dialog
  3. Multiple slot configuration dialog
  4. New "Supports Opt Limits" GUS (selector) slot filter (RootFilter)
  5. New TableSlot data members
  6. New TableSlot methods
  7. Control File/Exec-based DMI enhancements

(1) New TableSlot Configurations / Development Examples

Optimization Variable (X,Y,Z) / TableSlot Column index associations AND support for optimization checking limits (min/max) can now be configured for each TableSlot column on each Engineering Object. This is done in EngrObj source code.

For development testing and demonstration, nine TableSlots on Reservoir and PowerReservoir were provisionally configured with the new optimization variable / column associations. This is where the new Optimization TableSlot Limits (min/max) are enabled for particular TableSlot columns. (See items with "OPT_LIMITS", below). The TableSlot Columns supporting these limits can have specific Optimization Minimum and Maximum values assigned to them using the TableSlot (Column) configuration dialog or the multiple-slot configuration dialog.

The new TableSlot data members and public methods added to support these configurations are enumerated in a subsequent section.

Reservoir::setupPrototype() ...

// Set optimization variable / column index associations
elevVolTable -> setColIndexForOptX (EVT_STORAGE_COL, OPT_LIMITS);
elevVolTable -> setColIndexForOptY (EVT_ELEVATION_COL);
regulatedSpillTable -> setColIndexForOptX (RST_ELEVATION_COL, OPT_LIMITS);
regulatedSpillTable -> setColIndexForOptY (RST_SPILL_COL);
marginalStorVal -> setColIndexForOptX (0, OPT_LIMITS);
marginalStorVal -> setColIndexForOptY (1);
energyInStorageTable -> setColIndexForOptX (0, OPT_LIMITS);
energyInStorageTable -> setColIndexForOptY (1);

 

PowerReservoir::setupPrototype() ...

// Set optimization variable / column index associations
maxTurbineQ -> setColIndexForOptX (0, OPT_LIMITS);
maxTurbineQ -> setColIndexForOptY (1);
tailwaterTable -> setColIndexForOptX (0, OPT_LIMITS);
tailwaterTable -> setColIndexForOptY (1);
stageFlowTailwaterTable -> setColIndexForOptX (1, OPT_LIMITS);
stageFlowTailwaterTable -> setColIndexForOptY (2);
stageFlowTailwaterTable -> setColIndexForOptZ (0, OPT_LIMITS);
convolvedStageFlowTailwaterTable
    -> setColIndexForOptX (SFTW_OUTFLOW_COL, OPT_LIMITS);
convolvedStageFlowTailwaterTable
    -> setColIndexForOptZ (SFTW_STAGE_COL, OPT_LIMITS);
plantPowerTable -> setColIndexForOptX (1, OPT_LIMITS);
plantPowerTable -> setColIndexForOptY (2);
plantPowerTable -> setColIndexForOptZ (0, OPT_LIMITS);

(2) TableSlot column configuration dialog

The TableSlot single-column configuration dialog now presents an "Optimization Column Min and Max Values" panel if the column being edited is configured to support optimization checking limits.

(3) Multiple slot configuration dialog

The "Configure Existing Slots" dialog now supports two general modes of operation, selected with radio buttons in the lower-left (see image below):

  1. Standard -- (Conventional) Min/Max, Convergence, Unit Type for Slots on Data Objects
  2. Optimization -- New "Optimization Min and Max Values"

In Optimization mode ...

The new GUS slot filter (RootFilter) -- "Supports Opt Limits" -- is useful for picking slots to be added to this dialog. This will especially be useful for inspecting the Engineering Object TableSlot column configurations (done in EngrObj C++ code).

(4) New "Supports Opt Limits" GUS (selector) slot filter (RootFilter)

A new slot RootFilter has been added to match slots (TableSlots) having optimization checking limits enabled on any of their columns (in EngrObj C++ code). This includes TableSlots for which optimization checking limits CAN be set by the user, regardless of whether optimization minimum and maximum values have been set.

(5) New TableSlot data members

Note that new numeric min/max fields were created for this purpose instead of making use of the previously implemented (but marginally-used) min/max TableSlot fields. The existing min/max fields are similar to those on SeriesSlots which represent limits of all of the values in the series. The semantics for the new optimization limit checking fields are different: they don't represent limits of valid values -- they are intended only to constrain value checking operations for optimization.

// Optimization variable/column support
int _colIndexForOptX; // 'X' variable column; (-1): not used.
int _colIndexForOptY; // 'Y' variable column; (-1): not used.
int _colIndexForOptZ; // 'Z' variable column; (-1): not used.

bool _optXcolUsesLimits; // Does 'X' column support Optimization min/max?
bool _optZcolUsesLimits; // Does 'Z' column support Optimization min/max?

double _xColOptMin; // 'X' column optimization minimum
double _xColOptMax; // 'X' column optimization maximum
double _zColOptMin; // 'Z' column optimization minimum
double _zColOptMax; // 'Z' column optimization maximum

(6) New TableSlot methods

... for Optimization Variable (X,Y,Z) / TableSlot Column index associations AND for Optimization Checking Limits (min/max):

// Optimization variable/column support
void setColIndexForOptX (int, bool usesOptLimits=false); // or OPT_LIMITS
void setColIndexForOptY (int);
void setColIndexForOptZ (int, bool usesOptLimits=false); // or OPT_LIMITS

int colIndexForOptX() const { return _colIndexForOptX; } // (-1): n/a
int colIndexForOptY() const { return _colIndexForOptY; } // (-1): n/a
int colIndexForOptZ() const { return _colIndexForOptZ; } // (-1): n/a
bool optXcolUsesLimits() const { return _optXcolUsesLimits; }
bool optZcolUsesLimits() const { return _optZcolUsesLimits; }
QString optVariableNameForColumn (int col) const; // e.g. "X" or "Y" or "Z"

void setXcolOptLimits (double min, double max);
void setXcolOptMin (double min);
void setXcolOptMax (double max);
void setZcolOptLimits (double min, double max);
void setZcolOptMin (double min);
void setZcolOptMax (double max);

double xColOptMin() const { return _xColOptMin; }
double xColOptMax() const { return _xColOptMax; }
double zColOptMin() const { return _zColOptMin; }
double zColOptMax() const { return _zColOptMax; }

double usrColOptMin (int col, double scale, const QString& unit) const;
double usrColOptMax (int col, double scale, const QString& unit) const;
void setUsrColOptMin (int col, double v, double scale, const QString& unit);
void setUsrColOptMax (int col, double v, double scale, const QString& unit);

(7) Control File/Exec-based DMI enhancements

Control File/Exec-based DMIs were enhanced to support the new optimization TableSlot checking limits.  This includes support for per-column Scale and Unit records in TableSlot data files. (No provisions were added for control files).

TableSlot (and TableSeriesSlot) DMI data files -- both "all-column" and "single-column" variations -- now support these attribute fields:

  scale: <col 0 scale> <col 1 scale> ...
  units: <col 0 units> <col 1 units> ...
  opt_min: <col 0 opt min> <col 1 opt min> ...
  opt_max: <col 0 opt max> <col 1 opt max> ...


EXAMPLE (for a TableSlot on a Level Power Reservoir):

  # Table Slot: Apalachia.Regulated Spill Table
  # Column: [0] Elevation [1 ft]
  # Column: [1] Max Reg Spill [1000 cfs] 
  scale: 1 1000
  units: ft cfs
  opt_min: 14580.0524934 NaN
  opt_max: 18221.7847769 NaN


In the "single-column" TableSlot DMI data files, of course only one value is provided (for the particular TableSlot column).

With Output DMIs, the new attribute fields above are generated; each TableSlot's column's current display units (via Unit Schemes) are used (for Output).  Also comment headers are generated, but only if this legacy environment variable is NOT defined (introduced in 2003 for TVA): OLD_4P2_EXPORT_COMMENT_STYLE_SYM.

Previously, TableSlot DMI functions assumed the use of current display units for all columns -- for both input and output DMIs.  (Note that use of "scale" and "units" attributes in TableSlot control file records had, and still have no effect; in any case, their current specification would not accommodate different scale and units for individual TableSlot columns).  Various TableSlot DMI functions have been modified to use scale and units provided by per-column vectors of those attributes.

--- (end) ---