FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Output formatting for a transportation model

  • small LP problem
  • generate a nice printed output
  • using dynamic arrays for representing sparse data structures
  • reading several data arrays from a single data file
Further explanation of this example: 'Mosel User Guide', Section 3.2 A transport example and Section 10.1 Producing formatted output.

The section 'Traditional embedding: solving multiple scenarios' of the Xpress Whitepaper 'Embedding Optimization Algorithms' describes how to embed a similar transportation model into an application.

Source Files

Data Files


<vdl version="4.7">
    <!-- 'vdl' and 'vdl-page' must always be present -->
        <!-- Structural element 'section': print header text for a section -->
        <vdl-section heading="Comparison of scenario results">
                    <p><span vdl-text="Viewing "></span><span vdl-text="=scenarios.length"></span><span vdl-text=" scenario(s)."></span></p>
                <!-- Display the objective value -->
                <vdl-column heading="Total Cost">
                    <table class="insight-table table-main table-condensed">
                                <th vdl-repeat="=s in scenarios" vdl-text=""></th>
                                <td vdl-repeat="=s in scenarios" vdl-text="=insight.Formatter.formatNumber(s.entities.MincostSol.value, 
                <!-- Display 'flow' solution values using the default table format,
                     enabling pagewise display with 10 entries per page -->
                <vdl-column size="12" heading="Quantities transported">
                    <vdl-table page-mode="paged" page-size="10">
                        <vdl-table-column entity="flow" heading="" vdl-repeat="=s,i in scenarios" scenario="=i"></vdl-table-column>

Back to examples browserPrevious exampleNext example