SetVariableBounds method: OptInterface class
Syntax
SetVariableBounds(modelID, varArrayID, boundType, lowerBound, upperBound, &keyRecord [, changeModelBounds])
Description
The SetVariableBounds method overrides the bounding values specified for a model variable array, or for a variable within the array.
Parameters
| Parameter | Description |
|---|---|
|
modelID |
Specify as a string the name of the optimization model for which you want to override the bounding values. This is the name used for the model definition in Application Designer. |
|
varArrayID |
Specify as a string the name of the variable array being optimized. Your application documentation should provide this name. |
|
boundType |
Specify a system constant indicating which bounding values to override. The value you specify here determines how the lowerBound and upperBound parameters are applied to the specified model.
|
|
lowerBound |
Specify as a number the lower bound that should be applied to a variable or a variable array if the boundType parameter permits the override. You can also set this parameter to one of the following system constants: |
|
upperBound |
Specify as a number the upper bound that should be applied to a variable or a variable array if the boundType parameter permits the override. You can also set this parameter to one of the following system constants: |
|
&keyRecord |
Specify a record with the same key fields as the variable array being optimized. To override the bounding values specified for a single variable within the array, populate the record's key fields to specify the variable. To override the bounding values specified for the entire variable array, set all of the record's fields to a null value. Note: You must either provide values for all keys, or set them all to null values. |
|
changeModelBounds |
Specify a Boolean value:
|
Returns
%OptInter_Success if the method succeeds, %OptInter_Fail otherwise.
Example
Local Record &rec;
Local integer &result;
Local OptInterface &oi = CreateOptInterface();
Local float &objval = 0.0;
Local string &modelId = "QE_PSA_MODEL";
Local string &varArrayName = "X";
Local float &lb = 0.0;
Local float &ub = 0.0;
&rec = CreateRecord(Record.QEOPT_VAL_X_WRK);
&rec.QEOPT_RESINDEX.Value = 1;
&rec.QEOPT_SOLINDEX.Value = 2;
&rec.QEOPT_TIMEINDEX.Value = 3;
&result = &oi.SetVariableBounds(&modelId, &varArrayName,
%Opt_Upper_Bound, &lb, &ub, &rec, False);