gamsutil.gms : Generates some useful files from the Model Library

Description

Generates some useful files from the Model Library.


Reference

  • GAMS Development Corporation, Modeling Tool Box.

Small Model of Type : GAMS


Category : GAMS Model library


Main file : gamsutil.gms   includes :  gamsmod.inc  gamsref.inc

$title Generates some useful Files from the Model Library (GAMSUTIL,SEQ=190)

$onText
Generates some useful files from the Model Library.


GAMS Development Corporation, Modeling Tool Box.

The following system configuration/document files are written:

   gamslib.glb  IDE index and documentation
   modlibfs.txt Makefile input file

All files $included, read and written have to be in the same
directory. This program can be execute from another location
by using the GAMS parameter U1, for example:

   >gams gamsutil.190 U1=c:\oldd\alex\gams\gamslib\ver008\test\

Keywords: GAMS language features, GAMS model library
$offText

$setGlobal gamslib '%gams.u1%'

File
   glb   'IDE model library index' / '%gamslib%gamslib.glb'  /
   glist 'makefile index file'     / '%gamslib%modlibfs.txt' /;

Scalar first;

$offListing
$include gamsmod.inc
$onListing

*
* IDE modlib file
*
put glb
      'Version = 5'
   /  'LibraryName = GAMS Model Library %version%'
   /  'Columns = 7'
   /  '6 = SeqNr'
   /  '7 = Lic|G=Global Demo, D=Demo, L=Requires license'
   /  '1 = Name'
   /  '2 = Application Area'
   /  '3 = Type'
   /  '4 = Contributor'
   /  '5 = Description'
   /  'InitialSort = 3'
   /  '*$*$*$';

glb.lcase = 1;
loop((sm(s,m),sath(s,ath)),
   put / 'Files = ' m.tl:0 '.' s.tl:0; loop(incmap(inc,s), put ',', inc.tl:0;);
   glb.lcase = 2;
   put / '1 = '  m.tl:0;
   put / '2 = '; first = 1;
   loop(as(a,s)$first, put a.te(a); first = 0;);
   put / '3 = '; loop(tss(t,s), put t.tl;);
   glb.lcase = 0; put / '4 = ' ath.tl
       / '5 = ' m.te(m)
       / '6 = ' '000000':ceil(log(card(s) + 1)/log(10))
                put @(glb.cc - card(s.tl)) s.tl:0
       / '7 = ';
   put$tiny(s) 'G';
   put$big(s)  'L';
   put$(not big(s) and not tiny(s)) 'D';
   glb.lcase = 1;
   put_utilities 'glb'/ '%gamslib%' m.tl:0 '.' s.tl:0;
   put / 'Reference';
   put$(sum(sr(s,r),1) > 1) 's';
   put ':';
   loop(sr(s,r), put / r.te(r));
   put / '*$*$*$';
);
putClose;

*
* makefile input
*
$sTitle List of all Files in Makefile Format
glist.lcase = 1;
put glist 'MODLIBFILES = \'
        / 'gamslib.glb \'
        / 'modlib.log \' ;
loop(inc, put / inc.tl:0 ' \';);
loop(sm(s,m), put / m.tl:0 '.' s.tl:0 ' \';);
putClose / / glist;