https://github.com/ampl/ampls-api
AMPL Solver APIs
https://github.com/ampl/ampls-api
Last synced: 8 months ago
JSON representation
AMPL Solver APIs
- Host: GitHub
- URL: https://github.com/ampl/ampls-api
- Owner: ampl
- License: bsd-3-clause
- Created: 2019-11-07T15:13:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-27T17:55:56.000Z (over 1 year ago)
- Last Synced: 2025-09-25T12:34:48.110Z (9 months ago)
- Language: C++
- Homepage: https://ampls.readthedocs.io
- Size: 8.38 MB
- Stars: 5
- Watchers: 7
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: changes.md
- License: LICENSE
- Support: support/cmake/CopyListOfFiles.cmake
Awesome Lists containing this project
README
# AMPLS-API
[](https://dev.azure.com/ampldev/ampls-api/_build/latest?definitionId=9&branchName=master)
AMPLS-API is an open source set of lightweight interfaces between AMPL and solvers, which allow:
- Read in an AMPL model instance from an `NL` file
- Write out the solution as a `sol` file, ready to be imported by AMPL
- A choice between:
- Use of all the solver's capabilities, using its own C API functionalities
- Use of a (provided) generic interface, that encapsulates the most common
functionalities of the solver interfaces, permitting hassle-free solver swap
- Usage of existing AMPL licenses, when used together with the AMPL drivers
The interfaces are available for multiple languages; the core is written in C++ and it is wrapped using
[swig](https://www.swig.org) to other target languages.
## Documentation
- https://ampls.readthedocs.io/
## Solvers
- Gurobi
- CPLEX
- XPRESS
- Copt
## Languages
### Python
#### Examples
- Example: [Jupyter Notebook with TSP Example](python/examples/notebooks/tsp_simple_cuts_generic.ipynb)
- More examples:
- [python/examples/](python/examples/)
- [python/examples/notebooks/](python/examples/notebooks/)
#### Repositories
- PyPI Repository for amplpy-gurobi: https://pypi.python.org/pypi/amplpy-gurobi
- PyPI Repository for amplpy-cplex: https://pypi.python.org/pypi/amplpy-cplex
#### Setup
##### PyPI
Install from the PyPI repositories:
```
$ python -m pip install amplpy-gurobi amplpy-cplex
```
Note: For Windows, Linux, and macOS, the python packages come with binary wheels for many Python versions and platforms. Please make sure that you are using the latest version of `pip` before installing them (upgrade using `pip install pip --upgrade` or `python -m pip install pip --upgrade`). If a binary wheel for your platform or python version is not available, a C++ compiler and python development libraries will be required.
## License
BSD-3
***
Copyright © 2020-2021 AMPL Optimization inc. All rights reserved.