Solved

Writing Program and Solver Status using Dex: values rather than labels

  • 29 August 2023
  • 3 replies
  • 21 views

Badge +1

While writing the suffices ProgramStatus and SolverStatus from a MathematicalProgram identifier to an Excel file using DEX I get numeric values rather than the lables indicated in this table:

https://documentation.aimms.com/language-reference/optimization-modeling-components/solving-mathematical-programs/suffices-and-callbacks.html#table-mp-status

 

Is there any way to write these labels rather than the corresponding numeric values?

Otherwise, where could I find the corresponding mapping between the numeric values and the labels (status) referred in the previous table?

icon

Best answer by gdiepen 30 August 2023, 20:45

View original

3 replies

Userlevel 5
Badge +7

Not sure what code you are using to write the values, but one way you could force it to be a string is to use something like:

 

formatstring(“%e”, mpProblem.ProgramStatus)

Badge +1

 Thank you @gdiepen for your inputs.

I am using DEX to write the values into an Excel file. The code is the following:

<AimmsExcelMapping>
<ExcelSheetMapping name="Summary">
<RowMapping>
...
<ColumnMapping name="Program Status" maps-to="MathematicalProgram.ProgramStatus" />
<ColumnMapping name="Solver Status" maps-to="MathematicalProgram.SolverStatus" />
...
</ExcelSheetMapping>
</AimmsExcelMapping>

Note that I believe I cannot use formatstring(“%e”, MathematicalProgram.ProgramStatus) in DEX

Userlevel 5
Badge +7

What are the numbers that you see being written to Excel? Are those the ordinal values of these elements by any chance?

I think you might need somebody from AIMMS help out to really fix it (or provide the way it should work).

 

As a work-around, you could create two parameters:

spMathematicalProgramProgramStatus with definition formatstring(“%e”, MathematicalProgram.ProgramStatus)

spMathematicalProgramSolverStatus with definition formatstring(“%e”, MathematicalProgram.SolverStatus)

and write those two items to the excel file?

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator