Instructions For Foundation of Operations Research Lab Sessions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Instructions for Foundation of Operations Research lab sessions

(to do before the first lab session)

In the lab sessions the software AMPL and the solver CPLEX will be used, they have to be installed on the
laptop you are going to use during the lab sessions. The full version of the software is available on the
Beep page of the course; the license expires at the end of February.

Installation without graphical user interface


Download, according to your operating system, the AMPL zip file from the beep page of the course, all
files can be found in the subfolder AMPL inside folder Lab. Extract the content of the .zip file in a
directory of your choice.

To test the software, open a text shell (command prompt or terminal depending on your OS), go to the
directory in which you have extracted the .zip file (usually with command cd
complete_path_directory) and type: ampl (or ampl.exe or ./ampl depending on your OS). Now
you are in the AMPL shell (ampl: with a blinking cursor should appear), type these commands
followed by enter:

model test.mod;

data test.dat;

option solver

cplex;

solve; display x;
The outcome should be similar to the picture below.
Note that if you are on linux or MacOS you may have to use ./cplex instead of cplex in the
option solver cplex; command. Moreover, both files ampl and cplex may have to be flagged as
executable in order to run them.
If you need a graphical user interface the official AMPL IDE is available at:
http://ampl.com/products/ide/
Follow the instruction provided to install the IDE. Note that you need the AMPL version
downloaded from beep in order for the IDE to work.
Any question: [email protected]

You might also like