Exporting internal data

Describes how to export internally-initialized data (calculated data).

The IDE also enables you to export internal data in a model to a local .dat file. This may be useful for debugging purposes. Internal data are all data elements in a .mod file initialized by means of the syntax


= “(some expression here)"

For example, Routes, Supplies, and Customers are internal data in the following sample: (transp4.mod).

{route} Routes = { < p,<o,d> > | <p,o,d,c> in TableRoutes };
{connection} Connections = { c | <p, c> in Routes };
tuple supply{ 
  string p; 
  string o; 
}
{supply} Supplies = { <p,c.o> | <p,c> in Routes };
float Supply[Supplies] = ...; 
tuple customer {
  string p;
  string d;
} 
{customer} Customers = { <p,c.d> | <p,c> in Routes };
float Demand[Customers] = ...;

float Cost[Routes] = [ <t.p,<t.o,t.d>>:t.cost | t in TableRoutes ];

To export internal data from a model:

  1. Expand the project in the OPL Projects view and highlight the Run Configuration you want to export data for. Then open the Run menu and choose Browse As. Alternatively, you can execute the run configuration you want to export data for instead of browsing it.
  2. When the run has completed, open the Run menu in the main menu bar and choose Export internal data.

    A dialog box appears that allows you to choose the filename and location of the saved file. The default extension of the generated file is .dat, and by default, the file is saved in the same directory as the model file.

  3. Type a name for the file (for example, gasint.dat to avoid overwriting the distributed gas.dat file), and click Finish.
  4. Check for the resulting file (for example, in Windows Explorer) in the location you specified.

    The generated data file looks like a regular data file and you can open it in a text editor or in the IDE (although it does not appear in the project tree).

    Note:

    If the internal data is not used in the model, it will not be included in the generated data file.