next up previous contents
Next: B. Additional MDL Functions Up: A. A Tiny Algorithm Previous: A.5. Model Definition

A.6. MDL Input Deck

Example A.12 finally shows a possible implementation of an MDL Model definition for the generation of an gnuplot compatible table of lateral and vertical coordinate values of the complimentary error function when parsed by the above generated tinyapp program.

Therefore the MDL input deck starts by dynamically loading the MDL function extension library TinyAlibFuncExtLib which provides the MDL function erfc. The newly defined ErfcPlot Model inherits its Interface and the plot method from the GnuplotModel and generates in its evaluate method a list of associated dependent and non-dependent variable values of the erfc function within the MdlDblmap Interface Parameter map.


LoadObjectLibrary "TinyAlibFuncExtLib";

Instance TinyAppTest = ErfcPlot;
NewModel ErfcPlot : GnuplotModel {
   Local {
      protected Parameter<double> step;
      protected Parameter<double> x;
   evaluate {
     step = (:maxX - :minX)/:ptNr;
     x = :minX;
     while (x <= :maxX) {
        :map[x] = erfc(x);
        x += step;
     call plot;

Example A.12: The MDL input deck

Robert Mlekus