Você está na página 1de 5

Getting started on AMPL-SE with CPLEX!

1 Introduction
With these guidelines we are trying to lead students step-by-step towards solving the mrp and MRP II instances taken from the study book Introduction to Computational Optimization Models for Production Planning in a Supply Chain by Stefan Vo and David L. Woodruff (cf. 7.1). The software we are using is AMPL under Windows XP operating system. There are two ways in which AMPL is being provided by www.ampl.com, i.e., a web interface and the downloadable AMPL Student Edition (AMPL-SE). Either way multiple solvers may be used; among these within AMPL-SE is CPLEX which will be used.1

AMPL Homepage

Link to the AMPL Student Edition download


Figure 1 - www.ampl.com

First one needs to download AMPL-SE zip-package from www.ampl.com and extract it to a local directory. Follow the link in Figure 1!

Note that CPLEX is not available using the web interface

Question? Answer: eisenberg@econ.uni-hamburg.de or stefan.voss@uni-hamburg.de

Getting started on AMPL-SE with CPLEX!

2 Downloading and Installing AMPL-SE


The web page that you should have opened following the given link is depicted below:

L1

L3

L2

Here you may be interested in the following links: L1: free download of Chapter 1 of the AMPL book. L2: amplcml.zip depicts the zipped archive of AMPL-SE L3: instructions on how to use AMPL-SE We are following L2 and will be prompted to specify what to do with the download. We choose to download the archive to the root folder of our local drive C, e.g. C:\, which will keep the path to ampl.exe short. Next unzip the archive. As a result there should be a new folder C:\amplcml containing the ready-to-use Student Edition.

Question? Answer: eisenberg@econ.uni-hamburg.de or stefan.voss@uni-hamburg.de

Getting started on AMPL-SE with CPLEX!

3 Starting AMPL-SE with CPLEX


To start AMPL we recommend to open a command line window through the start menu (i.e. English: Start Run, German: Start Ausfhren Chinese could be: Kaishi Shixing). We enter cmd into the dialog and press Enter. The following window should appear immediately:

<Hit Enter!> <Hit Enter!> <Hit Enter!>

We now have to change into the ampl folder and start ampl, cf. the first two prompts in the window above. For configuring CPLEX as the solver to be used, we have to enter options solver cplex;. Now we are set to use AMPL-SE with CPLEX!

Question? Answer: eisenberg@econ.uni-hamburg.de or stefan.voss@uni-hamburg.de

Getting started on AMPL-SE with CPLEX!

4 Loading model and data


Prior to solving our instances we have to load the model and data file into ampl. We recommend saving the files in to the folder C:\amplcml.2 Once done, say for MRP II, we simply load the files by typing the commands model mrp2.mod; and data mrp2.dat; Our AMPL window should now look like this:

5 Solving
In order to solve the loaded instance we have to type solve;. As a result we obtain information about the solution process. Our problem instance has been solved by five iterations of the dual simplex algorithm and the objective function value is 530.

The model and problem instances may be found at this website: http://faculty.gsm.ucdavis.edu/~dlw/scm.html

Question? Answer: eisenberg@econ.uni-hamburg.de or stefan.voss@uni-hamburg.de

Getting started on AMPL-SE with CPLEX!

6 How to retrieve results


Knowing the objective function value is fine and an important achievement, however, it does not tell us anything on how to achieve this. Therefore, the content of our variables might be of interest. The display command will help us. In order to display the content of our decision variable we type display x;:

We now can see when and in which period to release the orders of a certain SKU. For further information the reader may be directed to the study book mentioned above as well as the free download of the first chapter of the AMPL book.

Question? Answer: eisenberg@econ.uni-hamburg.de or stefan.voss@uni-hamburg.de

Você também pode gostar