Skip to content

Calculation Engine

John Darragh edited this page Dec 8, 2021 · 1 revision

The application is built around a calculation engine - an algorithm that applies a hierarchical set of formulas to a set of input values to calculate a result. Each component of the calculation is stored in the database as a rule. Each calculation rule's value is calculated by a javascript function that depends on the value of its dependent (child) rules, so the entire graph is essentially a directed graph (tree) of calculation rules. When we get to the leaf nodes of this tree, they are simply values that have no children, and represent values that the user provides as input to the calculation. Somewhat arbitrarily, these leaf nodes are categorized as either input rules or measure (aka strategy) rules. This is specific to TDM and distinguish between project specification inputs (like Project Name, Number of square feet of retail space, etc.) and TDM Strategies that earn TDM points.

There is currently only one set of rules that comprise the official TDM calculation, though we expect in the future to need to keep different versions of the overall calculation as the rules change over time once the application is in production. This will require keeping multiple sets of rules and keeping track of which rules were in effect for which projects.

Clone this wiki locally