Parameters

Top  Previous  Next

Parameter format is used to enter items defined with respect to sets.  Generally parameter format is used with data items that are one-dimensional (vectors) although multidimensional cases can be entered.  The general format for parameter entry is:

 

Parameter         itemname(setdependency)  optional text

         / firstsetelementname  associated value,                                  

           secondsetelementname associated value,

                                 ...                /;

Examples:

PARAMETER          c(j)      / x1     3    ,x2   2 ,x3    0.5/;

Parameter          b(i)      /r1 10 ,r2 3/;

PARAMETERS

    PRICE(PROCESS)     PRODUCT PRICES BY PROCESS 

                                         /X1 3,X2 2,X3 0.5/;

           RESORAVAIL(RESOURCE)  RESOURCE AVAILABLITY          

                                     /CONSTRAIN1 10 ,CONSTRAIN2 3/;

Parameter         multidim(i,j,kthree dimensional

                               /i1.j1.k1 100 ,i2.j1.k2 90 /;

Notes:

The set elements referenced must appear in the defining set.  Thus when data are entered for c(j) the element names within the / designators must be in the set j.
More than one named item is definable under a single parameter statement with a semicolon terminating the total statement.
Note GAMS commands are always ended with a ; but can be multiline in nature.
Items can be defined over up to 20 sets with each numerical entry associated with a specific simultaneous collection of set elements for each of the named sets. When multi set dependent named items are entered then the notation is set1elementname.set2elementname.set3elementname etc with periods(.) setting off the element names in the associated sets.
All elements that are not given explicit values are implicitly assigned with a value of zero.
Parameters are an all-encompassing data class in GAMS into which data are kept including data entered as Scalars and Table.
More on parameters appears in the Data Entry chapter.