GetSolutionDetail method: OptInterface class
Syntax
GetSolutionDetail(ModelID, SolutionType, Name, &Solution)
Description
The GetSolutionDetail method retrieves the model solution detail of the specified type generated by the Solve method. You can retrieve dual value, slack value, or reduced cost information.
Parameters
| Parameter | Description |
|---|---|
|
ModelID |
Specify as a string the name of the optimization model for which you want the solution detail. This is the name used for the model definition in Application Designer. |
|
SolutionType |
Specify a system constant indicating the type of solution detail you want to retrieve. The value you specify here determines the content of the Name and &Solution parameters.
|
|
Name |
If you specified a SolutionType of %OPT_DUAL or %OPT_SLACK, specify here the name of a constraint block from the active model. If you specified a SolutionType of %OPT_RCOST, specify here the name of a variable array from the active model. |
|
&Solution |
Specify a rowset to contain the solution details. The rowset should have the same key fields as the constraint block or the variable array you specified with the Name parameter. |
Returns
This method returns a constant value. Valid values are:
| Value | Description |
|---|---|
|
%OptInter_Success |
Returned if method succeeds. |
|
%OptInter_Fail |
Returned if solver fails to solve the problem. |
Example
Local Rowset &dual_rowset;
Local integer &result;
Local OptInterface &oi = CreateOptInterface();
Local string &modelId = "QE_PSA_MODEL";
Local string &varArrayName = "X";
Local string &constrName = "Constraint_1";
/* fetch dual values for Contraint "Constraint_1"
in a rowset based on the QEOPT_C1_WRK record */
&dual_rowset = CreateRowset(Record.QEOPT_C1_WRK);
&result = &oi.GetSolutionDetail(&modelId, %Opt_Dual, &constrName, &dual_rowset);