Rufineer v0.43.0
Account
Browse the docs

Example 4 of 13

Mbira border post

Based on mbira-border-post-model.xlsm

The border post was built by copying the toll road workbook and rewriting the revenue sheets, so 22 of its 26 sheets match the toll model. In Rufineer the shared part becomes a package, and the border model only writes what is different. Design example: written in the full v0.5 language. The compiler builds the working core today, so this one doesn't compile yet. Source: examples/design/border/.

Workbook
26 sheets, same ruler and layout as the toll road
Revenue
6 vehicle classes, incoming and outgoing 2022 crossings, fees stepping up over three construction years
Other income
Residential rentals on 5,778 m²
Capital
Building and site works USD 17.4m, equipment USD 4.6m, wastewater plant USD 3.5m
Rebuild shown
4 files, 55 lines, plus the shared concession package

Where each sheet goes

Workbook sheetsRufineer
InpC (border inputs)inputs.rfn, with tables read from sheets of border_inputs.xlsx
Revrev.rfn
ConCostcons_cost.rfn (different cost lines)
All other sheetsthe shared concession package

Source 4 files shown, 55 lines

concession/package.rfn
/// Everything the toll road and border post have in common
package concession {
  requires  rev.total: USD, cons_cost.total: USD, ops.maintenance: USD
  provides  cons_fin, ops, debt, reserves, equity, tax, cash, metrics, statements, checks
}

What this model needed from the language

  • Packages with a stated interface. requires lists the lines a model must supply and provides lists what the package adds. A fix to the shared debt logic reaches both models in one change.
  • Guarded match. Fees step up by construction year. A match without a subject takes the first true condition.