About AMPL APIs
Our comprehensive Application Programming Interface (API) provides an object-oriented callable library that lets you access AMPL models and run AMPL commands from external programs. Data and results can be exchanged directly and efficiently between AMPL’s model entities and the external language’s data structures. Uses include:
Our instructions add AMPL API to an existing installation of command-line AMPL and solvers, after which you will be able to access AMPL from any popular version of your chosen language. Contact us at firstname.lastname@example.org if you need help completing the AMPL or API setup.
Who can access AMPL APIs?
AMPL API works with any purchased AMPL installation covered by current a maintenance & support service, and also with all trial and temporary versions. Contact us at email@example.com if you need help with reinstatement of maintenance or renewal of licenses.
Once you have installed your API you will find our extensive API documentation hosted on our documentation site. Use the links below to navigate to the pages you need.
AMPL API is an interface that allows developers to access the features of the AMPL interpreter from within a programming language.
The AMPL API can function as an add-on to any existing AMPL installation.
AMPL API library consists of a collection of classes to interact with the underlying AMPL interpreter and to access its inputs and outputs. It uses generic collections to represent the various entities which comprise a mathematical model. The structure of these entities is explained in this section.
These links will show a simple example to illustrate various functionalities. The full example prints the version of the AMPL interpreter used, loads a model from file and the corresponding data file, solves it, gets some of the AMPL entities in your programming language and uses them to get the results and to assign data programmatically. The documentation in this section assumes that you are already familiar with the programming language you select.
All functions and classes provided by the AMPL API are described in this section.
This section lists a few examples in your selected programming language. These are the same files that can be found in the examples directory of the distribution, and show the basic usage of the API.