16.01.2015 Views

GAMS — The Solver Manuals - Available Software

GAMS — The Solver Manuals - Available Software

GAMS — The Solver Manuals - Available Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MPSWRITE 413<br />

place. For example, when running under Windows 95 we could add a solver called ANALYZE that uses the same<br />

settings as MPSWRITE in the appropriate <strong>GAMS</strong> configuration file. <strong>The</strong> new ANALYZE script then could look<br />

as follows.<br />

@echo off<br />

: gmsan\_95.bat: Command Line Interface for Win 95<br />

echo * ANALYZE defaults > analyze.opt<br />

echo nametyp 2 >> analyze.opt<br />

echo namewid 16 >> analyze.opt<br />

echo dobas 0 >> analyze.opt<br />

echo domap 2 >> analyze.opt<br />

echo domps 2 >> analyze.opt<br />

echo textopt 1 >> analyze.opt<br />

echo * MPSWRITE Option >> analyze.opt<br />

: append mpswrite options<br />

if exist mpswrite.opt copy analyze.opt + mpswrite.opt analyze.opt<br />

gmsmp\_nx.exe %4<br />

if exist analyze.opt del analyze.opt<br />

:<br />

echo LOAD <strong>GAMS</strong> > profile.exc<br />

echo WRITE <strong>GAMS</strong> >> profile.exc<br />

echo QUIT >> profile.exc<br />

:lprename > lprename.out<br />

LPRENAME<br />

:<br />

echo $ ============ > profile.exc<br />

echo $ <strong>GAMS</strong>/ANALYZE >> profile.exc<br />

echo $ ============ >> profile.exc<br />

echo READIN PAC <strong>GAMS</strong> >> profile.exc<br />

echo READIN SYN <strong>GAMS</strong> >> profile.exc<br />

echo SUMMARY >> profile.exc<br />

echo $ >> profile.exc<br />

echo RETURN >> profile.exc<br />

if not exist credits.doc goto ok<br />

: need to remove credits to prevent early prompt<br />

if exist credits.hld delete credits.hld<br />

rename credits.doc credits.hld<br />

:ok<br />

ANALYZE<br />

Note that LPRENAME and ANALYZE are assumed to be accessible through the path or can be found in the<br />

current directory. If this is not the case, you has to enter the appropriate path to the script file above. Also note<br />

the use of the ANALYZE profile feature. <strong>The</strong> profile.exc file is executed only after the credits have been processed.<br />

<strong>The</strong> only way to avoid having to respond with Y/N to ANALYZE questions interactively is the renaming of the<br />

credits.doc file. If no credits.doc file is found by ANALYZE, it will immediately look for a profile.exc file and<br />

execute the commands included in this file.<br />

Let us return to the [TRNSPORT] example and call ANALYZE after we have computed an optimal solution as<br />

follows:<br />

solve<br />

option<br />

solve<br />

transport using lp minimizing cost;<br />

lp=analayze;<br />

transport using lp minimizing cost;<br />

<strong>The</strong> second solve statement will generate the appropriate input files for ANALYZE and load the problem into<br />

the analyze workspace. Not that ANALYZE has recognized that the model is optimal and the model is ready to<br />

be inspected using ANALYZE commands as shown below:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!