INDEX TO EXAMPLES

LOOPING AND TESTING 1:
writing "scripts" in the AMPL command language


All examples use steelT.mod as the model file and steelT.dat as the data file.


Script file Implements
steelT.sa1 One pass of sensitivity analysis on avail[3] in the multi-period production problem (Section 4.2)
steelT.sa1a
steelT.sa1b
Same as steelT.sa1 but split into two scripts, using the commands command
steelT.sa2 Iterated sensitivity analysis, using contents of steelT.sa1a and steelT.sa1b within a for loop
steelT.sa3 . . . also building a table of results
steelT.sa4 . . . also using repeat until, and building up an index set for the table
steelT.sa5 . . . also using if to record only those parameter values at which the dual price changes
steelT.sa6 Binary search to find a breakpoint in the dual value
steelT.sa6a . . . also handling the case of more than one breakpoint in the initial interval
steelT.sa6b . . . also counting the extra breakpoints detected
steelT.sa7 Sensitivity analysis using break and continue
steelT.sa7a . . . also for each t, printing at the end of each pass
steelT.sa7b . . . also for each t, storing all values until the end
steelT.sa7c . . . also incorporating a break criterion requiring a named loop
steelT.tab0 Data-specific script for a formatted table
steelT.tab1 General script for formatted table, using a for loop
steelT.tab2 . . . also with if statement to suppress printing of 100%



Comments or questions?
Write to info@ampl.com or use our comment form.

Return to the AMPL update page.

Return to the AMPL home page.


LAST MODIFIED 7 FEBRUARY 1996 BY 4er@iems.nwu.edu.