5 Model data

Model data include elemental sets, which are “values” of model sets, and numeric and symbolic values of model parameters.

In MathProg there are two different ways to saturate model sets and parameters with data. One way is simply providing necessary data using the assign attribute. However, in many cases it is more practical to separate the model itself and particular data needed for the model. For the latter reason in MathProg there is other way, when the model description is divided into two parts: model section and data section.

Model section is a main part of the model description that contains declarations of all model objects and is common for all problems based on that model.

Data section is an optional part of the model description that contains model data specific for a particular problem.

In MathProg model and data sections can be placed either in one text file or in two separate text files.

If both model and data sections are placed in one file, the file is composed as follows:

+------------+
| statement  |
| statement  |
| . . .      |
| statement  |
| data;      |
| data block |
| data block |
| . . .      |
| data block |
| end;       |
+------------+

If the model and data sections are placed in two separate files, the files are composed as follows:

+------------+   +------------+
| statement  |   | data;      |
| statement  |   | data block |
| . . .      |   | data block |
| statement  |   | . . .      |
| end;       |   | data block |
|            |   | end;       |
+------------+   +------------+
  Model file       Data file
Note:

If the data section is placed in a separate file, the keyword data is optional and may be omitted along with the semicolon that follows it.