trylin01.gms : Test model attribute TryLinear

Description

Run trnsport with transport.trylinear = 1 using different combinations of model
types, solvers, and solvelink choices and make sure the final model type and
solver used is correct

Contributor: Jan-H. Jagla, April 2010


Small Model of Type : GAMS


Category : GAMS Test library


Main file : trylin01.gms

$title Test model attribute TryLinear (TRYLIN01,SEQ=482)

$onText
Run trnsport with transport.trylinear = 1 using different combinations of model
types, solvers, and solvelink choices and make sure the final model type and
solver used is correct

Contributor: Jan-H. Jagla, April 2010
$offText

$onEcho > trnstl.gms
  Sets
       i   canning plants   / seattle, san-diego /
       j   markets          / new-york, chicago, topeka / ;
  Parameters
       a(i)  capacity of plant i in cases
         /    seattle     350
              san-diego   600  /
       b(j)  demand at market j in cases
         /    new-york    325
              chicago     300
              topeka      275  / ;
  Table d(i,j)  distance in thousands of miles
                    new-york       chicago      topeka
      seattle          2.5           1.7          1.8
      san-diego        2.5           1.8          1.4  ;
  Scalar f  freight in dollars per case per thousand miles  /90/ ;
  Parameter c(i,j)  transport cost in thousands of dollars per case ;
            c(i,j) = f * d(i,j) / 1000 ;
  Variables
       x(i,j)  shipment quantities in cases
       z       total transportation costs in thousands of dollars ;
  Positive Variable x ;
  Equations
       cost        define objective function
       supply(i)   observe supply limit at plant i
       demand(j)   satisfy demand at market j ;
  cost ..        z  =e=  sum((i,j), c(i,j)*x(i,j)) ;
  supply(i) ..   sum(j, x(i,j))  =l=  a(i) ;
  demand(j) ..   sum(i, x(i,j))  =g=  b(j) ;
  Model transport /all/ ;
  transport.trylinear = 1;
  Solve transport using %MTYPE% minimizing z ;
$offEcho

$onEchoV > tlscript.gms
$log --MTYPE=%2 %3=%4 solvelink=%5
$call gams trnstl lo=2 --MTYPE=%2 %3=%4 solvelink=%5
$echo %3  > shouldbe.txt
$echo %4 >> shouldbe.txt
$call grep "^     TYPE    " trnstl.lst | tr -s " " | cut -d" " -f3  > is.txt
$call grep "^     SOLVER  " trnstl.lst | tr -s " " | cut -d" " -f3 >> is.txt
$call diff -bw shouldbe.txt is.txt
$if errorlevel 1 $abort --MTYPE=%2 %3=%4 solvelink=%5 failed
$offEcho

$batInclude tlscript.gms 1 QCP    LP   SOPLEX  %solveLink.chainScript%
$batInclude tlscript.gms 1 NLP    LP   SOPLEX  %solveLink.chainScript%
$batInclude tlscript.gms 1 DNLP   LP   SOPLEX  %solveLink.chainScript%
$batInclude tlscript.gms 1 RMIQCP RMIP SOPLEX  %solveLink.chainScript%
$batInclude tlscript.gms 1 RMINLP RMIP SOPLEX  %solveLink.chainScript%
$batInclude tlscript.gms 1 MIQCP  MIP  SCIP    %solveLink.chainScript%
$batInclude tlscript.gms 1 MINLP  MIP  SCIP    %solveLink.chainScript%

$batInclude tlscript.gms 1 QCP    LP   SOPLEX  %solveLink.callScript%
$batInclude tlscript.gms 1 NLP    LP   SOPLEX  %solveLink.callScript%
$batInclude tlscript.gms 1 DNLP   LP   SOPLEX  %solveLink.callScript%
$batInclude tlscript.gms 1 RMIQCP RMIP SOPLEX  %solveLink.callScript%
$batInclude tlscript.gms 1 RMINLP RMIP SOPLEX  %solveLink.callScript%
$batInclude tlscript.gms 1 MIQCP  MIP  SCIP    %solveLink.callScript%
$batInclude tlscript.gms 1 MINLP  MIP  SCIP    %solveLink.callScript%

$batInclude tlscript.gms 1 QCP    LP   SOPLEX  %solveLink.callModule%
$batInclude tlscript.gms 1 NLP    LP   SOPLEX  %solveLink.callModule%
$batInclude tlscript.gms 1 DNLP   LP   SOPLEX  %solveLink.callModule%
$batInclude tlscript.gms 1 RMIQCP RMIP SOPLEX  %solveLink.callModule%
$batInclude tlscript.gms 1 RMINLP RMIP SOPLEX  %solveLink.callModule%
$batInclude tlscript.gms 1 MIQCP  MIP  SCIP    %solveLink.callModule%
$batInclude tlscript.gms 1 MINLP  MIP  SCIP    %solveLink.callModule%

$batInclude tlscript.gms 1 QCP    LP   SOPLEX  %solveLink.loadLibrary%
$batInclude tlscript.gms 1 NLP    LP   SOPLEX  %solveLink.loadLibrary%
$batInclude tlscript.gms 1 DNLP   LP   SOPLEX  %solveLink.loadLibrary%
$batInclude tlscript.gms 1 RMIQCP RMIP SOPLEX  %solveLink.loadLibrary%
$batInclude tlscript.gms 1 RMINLP RMIP SOPLEX  %solveLink.loadLibrary%
$batInclude tlscript.gms 1 MIQCP  MIP  SCIP    %solveLink.loadLibrary%
$batInclude tlscript.gms 1 MINLP  MIP  SCIP    %solveLink.loadLibrary%

* Now try solvers that support in-core communication (solvelink=5)
$batInclude tlscript.gms 2 QCP    LP   CONOPT %solveLink.chainScript%
$batInclude tlscript.gms 2 NLP    LP   CONOPT %solveLink.chainScript%
$batInclude tlscript.gms 2 DNLP   LP   CONOPT %solveLink.chainScript%
$batInclude tlscript.gms 2 RMIQCP RMIP CONOPT %solveLink.chainScript%
$batInclude tlscript.gms 2 RMINLP RMIP CONOPT %solveLink.chainScript%
$batInclude tlscript.gms 2 MIQCP  MIP  CPLEX  %solveLink.chainScript%
$batInclude tlscript.gms 2 MINLP  MIP  CPLEX  %solveLink.chainScript%

$batInclude tlscript.gms 2 QCP    LP   CONOPT %solveLink.callScript%
$batInclude tlscript.gms 2 NLP    LP   CONOPT %solveLink.callScript%
$batInclude tlscript.gms 2 DNLP   LP   CONOPT %solveLink.callScript%
$batInclude tlscript.gms 2 RMIQCP RMIP CONOPT %solveLink.callScript%
$batInclude tlscript.gms 2 RMINLP RMIP CONOPT %solveLink.callScript%
$batInclude tlscript.gms 2 MIQCP  MIP  CPLEX  %solveLink.callScript%
$batInclude tlscript.gms 2 MINLP  MIP  CPLEX  %solveLink.callScript%

$batInclude tlscript.gms 2 QCP    LP   CONOPT %solveLink.callModule%
$batInclude tlscript.gms 2 NLP    LP   CONOPT %solveLink.callModule%
$batInclude tlscript.gms 2 DNLP   LP   CONOPT %solveLink.callModule%
$batInclude tlscript.gms 2 RMIQCP RMIP CONOPT %solveLink.callModule%
$batInclude tlscript.gms 2 RMINLP RMIP CONOPT %solveLink.callModule%
$batInclude tlscript.gms 2 MIQCP  MIP  CPLEX  %solveLink.callModule%
$batInclude tlscript.gms 2 MINLP  MIP  CPLEX  %solveLink.callModule%

$batInclude tlscript.gms 2 QCP    LP   CONOPT %solveLink.loadLibrary%
$batInclude tlscript.gms 2 NLP    LP   CONOPT %solveLink.loadLibrary%
$batInclude tlscript.gms 2 DNLP   LP   CONOPT %solveLink.loadLibrary%
$batInclude tlscript.gms 2 RMIQCP RMIP CONOPT %solveLink.loadLibrary%
$batInclude tlscript.gms 2 RMINLP RMIP CONOPT %solveLink.loadLibrary%
$batInclude tlscript.gms 2 MIQCP  MIP  CPLEX  %solveLink.loadLibrary%
$batInclude tlscript.gms 2 MINLP  MIP  CPLEX  %solveLink.loadLibrary%