TRY NOW!
AMPL > >Resources > >AMPL API > >AMPL API 0.2.2 Release Notes

AMPL API 0.2.2 Release Notes

Here “[Breaking]” means the change that may break valid user code, “[Fix]” – a bug fix.

  • [Breaking] AMPL.setData now has two overloads, setData(DataFrame) and setData(DataFrame, String). These replace the method setData(DataFrame, bool). The code

    ampl.setData(dataFrame, false);
    

    should be replaced with

    ampl.setData(dataFrame);
    

    in the new version. Similarly, the code

    ampl.setData(dataFrame, true);
    

    should be replaced with

    ampl.setData(dataFrame, setName);
    

    where setName is the name of a set to receive the data from the key columns of the data frame. This allows providing data for multidimensional sets.

  • [Breaking] Entity.getIndexingSets now returns an empty array instead of null for scalar parameters.

  • AMPL class can now be used in the try-with-resources statement:

    try (AMPL ampl = new AMPL()) {
      // use ampl
    }
    
  • Performance improvements in DataFrame.setMatrix, Variable.fix and other methods

  • Improved error reporting from Set.setValues

  • [Fix] ampl.display does not show an error if called on a non existent entity

  • [Fix] AMPL.setData silently ignores data for scalar parameter

  • [Fix] Incorrect processing of indexed sets in indexing

  • [Fix] Entity.getValues() throws NumberFormatException when indexing set is empty

  • [Fix] Objective.value() returns the old value after changing variable used in objective