Skip to main content

Constraints

Sketch the Model
Variables Objectives Constraints
Step-by-step we ideate model variables and constraints, jotting these down initially as natural language comments in our new AMPL model.mod file.
Write the Model
AMPL Constraints Memory Efficiency
One-by-one we convert our natural language comments representing model vars and constraints into actual model entities. In the process, we add display statements for health-checking the memory size and cardinality of our new model element.
Make on-the-fly model mods
Constraints App Logic Model Assembly at Runtime AMPL
We add functionality to our script that drops unneeded constraints per user-specified options, effectively changing the form of our optimization model on-the-fly. We also discuss extreme approaches to such run-time model construction, in light of the modular nature of optimization model components.
The Five Parts of an Optimization Model
Model-Data Separation Constraints Objectives
An unpacking of the five major components of an optimization model: SETS, parameters, Variables, Objective and Constraints.