Python API
Introduction
Getting started
Class structure
Python quick start
Python API reference
Python API examples
GitHub
GitHub
AMPL Resources
AMPL Resources
AMPL Portal
AMPL Portal
Discourse
Discourse
AMPL Pages ▼
AMPL Pages
AMPL.com
AMPL Discourse
AMPL Resources
AMPL License Portal
AMPL Model Colaboratory
AMPL Community Edition
Open Source Projects
AMPL GSL
AMPL Plugins
amplpy: Python API
rAMPL: R API
amplpyfinance
Solver Callbacks
MP: Solver Interface Framework
Follow us on
Twitter
and
LinkedIn
to get the latest updates from the dev team!
On this page
Contents
AMPL Python API
¶
Contents
¶
Introduction
What is AMPL API?
Who can use AMPL API
System requirements
About this manual
Getting started
Installation
amplpy.modules
Initial test
Development
Deployment
Class structure
AMPL class
Modelling entities classes
Relation between entities and data
Python quick start
Complete listing
Needed modules and AMPL environment creation
Load a model from file
Solve a problem
Get an AMPL entity in the programming environment (get objective value)
Modify model data (assign values to parameters)
Get numeric values from variables
Get arbitrary values via ampl expressions
Python API reference
AMPL classes
Algebraic entities classes
Exceptions
Python API examples
Example 1: First steps
Example 2: Get and set AMPL options
Example 3: Assign all data to a model and solve it
Example 4: Build an efficient frontier
Example 5: Simple heuristic
next
Introduction