GAMS Corporation has recently released version 21.3 and shortly thereafter an update for GDX. Version 21.3 expands some language capabilities. Release notes are on the GAMS web site at http://www.gams.com/docs/release/release.htm#21.3. New features within this release are discussed in the last newsletter. The software can be downloaded but is only useful if you have a current license file.
TCOSTEQ.. TCOST=E=SUM((PLANT,MARKET)$( supply(plant) and demand(market)
and distance(plant,market))
,SHIPMENTS(PLANT,MARKET)* COST(PLANT,MARKET));
SUPPLYEQ(PLANT).. SUM(MARKET)$( supply(plant) and demand(market)
and distance(plant,market))
,SHIPMENTS(PLANT, MARKET)) =L= SUPPLY(PLANT);
DEMANDEQ(MARKET).. SUM(PLANT)$( supply(plant) and demand(market)
and distance(plant,market))
,SHIPMENTS(PLANT, MARKET)) =G= DEMAND(MARKET);
where the alternative with the tuple is
set thistuple(plant,market) thistuple expressing conditional;
thistuple(plant,market)$(supply(plant) and demand(market)
and distance(plant,market)) =yes;
TCOSTEQ2.. TCOST =E= SUM(thistuple(plant,market)
,SHIPMENTS(PLANT,MARKET)* COST(PLANT,MARKET));
SUPPLYEQ2(PLANT).. SUM(thistuple(plant,market)
,SHIPMENTS(PLANT, MARKET)) =L= SUPPLY(PLANT);
DEMANDEQ2(MARKET).. SUM(thistuple(plant,market)
,SHIPMENTS(PLANT, MARKET)) =G= DEMAND(MARKET);
More on tuples appears in the McCarl Users Guide 2003 accessible through the IDE or accessible through the web in the sets, calculations and conditionals chapters.
IBM has stopped marketing OSL and with this planned future development and maintenance. GAMS Development will continue to keep OSL updated to the extent possible. In addition GAMS has worked out an OSL trade in agreement permitting migration to CPLEX, MOSEK, XA and XPRESS. For details see http://www.gams.com/solvers/solvers.htm#OSL.
A new option command exists which allows one to rapidly count the number of elements in a particular slice of a parameter. Suppose we have Q(I,J,K) and want to know how many elements exist for a set element I across all combinations of the subscripts J and K. This can be done using the option command
set i /1*3/
j /1*3/
k /1*3/;
Parameter Q(I,J,K) / 1.1.1 1, 1.2.3 3, 2.1.1 4/ ;
Parameter Elementcount(I) ;
option elementcount< Q ;
display elementcount;
Whereupon the elementcount parameter would contain a count of the
number of nonzero elements in Q associated with each element of the
set I. Similarly one could develop a count of the number of nonzero
entries within Q for each pairing of the elements J and K across all
values of the subscript I. by inserting
Parameter Elcount(J,K) ;
option elcount< Q ;
display elcount
Some users work on machines where the casing of file names is an issue. GAMS has introduced an option that allows automatic manipulation of all file names. By default file names are passed maintaining the casing as typed in the command. This can be overridden with the GAMS command line parameter FILECASE=n, where
| n=0 means to retain original casing (default) |
| n=1 uppercase the filename, and |
| n=2 will lowercase the filename. |
This newsletter is not a GAMS Corporation product but it is distributed with their cooperation.
February 18, 2004