Previous: , Up: Model data   [Contents]

### 5.3 Parameter data block

 param name , record , $\dots$ , record ; param name default value , record , $\dots$ , record ; param : tabbing-data ; param default value : tabbing-data ;
Where:

name is a symbolic name of the parameter;

value is an optional default value of the parameter;

record, $\dots$, record are data records.

tabbing-data specifies parameter data in the tabbing format.

Note:

Commae preceding data records may be omitted.

Data records:

:=

is a non-significant data record which may be used freely to improve readability;

[ slice ]

specifies a slice;

plain-data

specifies parameter data in the plain format;

: tabular-data

specifies parameter data in the tabular format;

(tr) : tabular-data

specifies parameter data in the transposed tabular format. (In this case the colon following the keyword (tr) may be omitted.)

Examples

param T := 4;
param month := 1 Jan 2 Feb 3 Mar 4 Apr 5 May;
param month := [1] 'Jan', [2] 'Feb', [3] 'Mar', [4] 'Apr', [5] 'May';
param init_stock := iron 7.32 nickel 35.8;
param init_stock [*] iron 7.32, nickel 35.8;
param cost [iron] .025 [nickel] .03;
param value := iron -.1, nickel .02;
param       : init_stock  cost  value :=
iron       7.32     .025   -.1
nickel    35.8      .03     .02 ;
param : raw : init stock  cost  value :=
iron     7.32     .025   -.1
nickel  35.8      .03     .02 ;
param demand default 0 (tr)
:  FRA  DET  LAN  WIN  STL  FRE  LAF :=
bands  300   .   100   75   .   225  250
coils  500  750  400  250   .   850  500
plate  100   .    .    50  200   .   250 ;
param trans_cost :=
[*,*,bands]:  FRA  DET  LAN  WIN  STL  FRE  LAF :=
GARY     30   10    8   10   11   71    6
CLEV     22    7   10    7   21   82   13
PITT     19   11   12   10   25   83   15
[*,*,coils]:  FRA  DET  LAN  WIN  STL  FRE  LAF :=
GARY     39   14   11   14   16   82    8
CLEV     27    9   12    9   26   95   17
PITT     24   14   17   13   28   99   20
[*,*,plate]:  FRA  DET  LAN  WIN  STL  FRE  LAF :=
GARY     41   15   12   16   17   86    8
CLEV     29    9   13    9   28   99   18
PITT     26   14   17   13   31  104   20 ;


The parameter data block is used to specify complete data for a parameter (or parameters, if data are specified in the tabbing format) whose name is given in the block.

Data blocks can be specified only for the parameters, which are non-computable, i.e. which have no assign attribute in the corresponding parameter statements.

Data defined in the parameter data block are coded as a sequence of data records described below. Additionally the data block can be provided with the optional default attribute, which specifies a default numeric or symbolic value of the parameter (parameters). This default value is assigned to the parameter or its members, if no appropriate value is defined in the parameter data block. The default attribute cannot be used, if it is already specified in the corresponding parameter statement(s).

#### Assign data record

The assign (:=) data record is a non-signficant element. It may be used for improving readability of data blocks.

#### Slice data record

The slice data record is a control record which specifies a slice of the parameter array. It has the following syntactic form:

[ $s_1$ , $s_2$ , $\dots$ , $s_n$ ]

where $s_1, s_2, \dots, s_n$ are components of the slice.

Each component of the slice can be a number or symbol or the asterisk (|*|). The number of components in the slice must be the same as the dimension of the parameter. For instance, if the parameter is a 4-dimensional array, the slice must have four components. The number of asterisks in the slice is called slice dimension.

The effect of using slices is the following. If a m-dimensional slice (i.e. a slice which has m asterisks) is specified in the data block, all subsequent data records must specify subscripts of the parameter members as if the parameter were m-dimensional, not n-dimensional.

Whenever m subscripts are encountered, each asterisk in the slice is replaced by corresponding subscript that gives n subscripts, which define the actual parameter member. For example, if the slice [a,*,1,2,*] is in effect, and the subscripts 3 and b are encountered in a subsequent data record, the complete subscript list used to choose a parameter member is [a,3,1,2,b].

It is allowed to specify a slice that has no asterisks. Such slice itself defines a complete subscript list, in which case the next data record can define only a single value of the corresponding parameter member.

Being once specified the slice effects until either a new slice or the end of data block has been encountered. Note that if there is no slice specified in the data block, a dummy one, components of which are all asterisks, is assumed.

#### Plain data record

The plain data record defines the subscript list and a single value in plain format. This record has the following syntactic form:

$t_1$ , $t_2$ , $\dots$ , $t_n$ , $v$

where $t_1, t_2, \dots, t_n$ are subscripts, $v$ is a value. Each subscript as well as the value can be a number or symbol. Commae following subscripts are optional and may be omitted.

In case of 0-dimensional parameter or slice the plain data record have no subscripts and consists of a single value only.

#### Tabular data record

The tabular data record defines several values, where each value is provided with two subscripts. This record has the following syntactic form:

$\matrix{ {\tt :} & c_1 & c_2 & \dots & c_n & {\tt :=} \cr r_1 & a_{11} & a_{12} & \dots & a_{1n} & \cr r_2 & a_{21} & a_{22} & \dots & a_{2n} & \cr \dots & \dots & \dots & \dots & \dots & \cr r_m & a_{m1} & a_{m2} & \dots & a_{mn} & \cr }$

where $r_1, r_2, \dots, r_m$ are numbers and/or symbols which correspond to rows of the table, $c_1, c_2$, $\dots, c_n$ are numbers and/or symbols which correspond to columns of the table, $a_{11}, a_{12}, \dots, a_{mn}$ are the table elements. Each element can be a number or symbol or the single decimal point. (In this data record the delimiter : preceding the column list and the delimiter := following the column list cannot be omitted.)

Each element $a_{ij}$ of the tabular data block ($1\leq i\leq m, 1\leq j\leq n$) defines two subscripts, where the first subscript is $r_i$, and the second one is $c_j$. These subscripts are used in conjunction with the current slice to form the complete subscript list which identifies a particular member of the parameter array. If $a_{ij}$ is a number or symbol, this value is assigned to the parameter member. However, if $a_{ij}$ is the single decimal point, the member is assigned a default value specified either in the parameter data block or in the parameter statement, or, if no default value is specified, the member remains undefined.

Since the tabular data record provides two subscripts for each value, either the parameter or the slice currently used must be 2-dimensional.

#### Transposed tabular data record

The transposed tabular data record has the following syntactic form:

$\matrix{ {\tt (tr)\ :} & c_1 & c_2 & \dots & c_n & {\tt :=} \cr r_1 & a_{11} & a_{12} & \dots & a_{1n} & \cr r_2 & a_{21} & a_{22} & \dots & a_{2n} & \cr \dots & \dots & \dots & \dots & \dots & \cr r_m & a_{m1} & a_{m2} & \dots & a_{mn} & \cr }$

(In this case the delimiter : following the keyword (tr) is optional and may be omitted.)

This data record is completely analogous to the tabular data record (see above) with the only exception that the first subscript defined by the element $a_{ij}$ is $c_j$ while the second one is $r_i$.

Being once specified the (tr) indicator effects on all subsequent data records until either a slice or the end of data block has been encountered.

#### Tabbing data format

The parameter data block in the tabbing format has the following syntactic form:

$\matrix{ {\tt param\ default}\ {\it value} : s :&p_1\ ,&p_2\ ,&\dots\ ,&p_k \ :=\cr \hfill t_{11}\ ,\ t_{12}\ ,\ \dots\ ,\ t_{1n}\ ,&a_{11}\ ,&a_{12}\ ,& \dots\ ,&a_{1k}\hfill\cr \hfill t_{21}\ ,\ t_{22}\ ,\ \dots\ ,\ t_{2n}\ ,&a_{21}\ ,&a_{22}\ ,& \dots\ ,&a_{2k}\hfill\cr \ \ \ \ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .\ \ .& \dots&\dots&\dots\ \ &\dots\ \ \ \cr \hfill t_{m1}\ ,\ t_{m2}\ ,\ \dots\ ,\ t_{mn}\ ,&a_{m1}\ ,&a_{m2}\ ,& \dots\ ,&a_{mk}\ ;\hfill\cr }$

Note:

The keyword default may be omitted along with a value following it.

The symbolic name $s$ of a set may be omitted along with the colon following it.

All comae are optional and may be omitted.

The data block in the tabbing format shown above is exactly equivalent to the following data blocks:

set $s:=(t_{11},t_{12},\dots,t_{1n})\ (t_{21},t_{22}, \dots,t_{2n})\ \dots\ (t_{m1},t_{m2},\dots,t_{mn})$ ;

param $p_j$ default value :=

$[t_{11},t_{12},\dots,t_{1n}]\ a_{1j} \ [t_{21},t_{22},\dots,t_{2n}]\ a_{2j}\ \dots\ [t_{m1},t_{m2},\dots, t_{mn}]\ a_{mj}$ ;

where j = 1, 2, $\dots$, k.

Previous: , Up: Model data   [Contents]