DECCF · Cash Flow Modeler and Calculator

Use preconditions and run inputs

A precondition is a named reference to a value the model can read. Create it with input, then give it a name in defineModel().

input.decimal, rate, fraction, integer, date, money, and textfile create scalar inputs. A fraction must be between zero and one, and an integer must be whole. Numeric inputs must be finite and can have an explicit numeric domain. input.date() accepts an ISO date or year-month and can be used for timeline starts and schedule dates that are resolved during compilation. input.textfile(defaultText = "") stores a string. In the Calculator, its editor is a local text-file picker; the file contents are supplied to the run as that string. In JavaScript, pass the content directly with deterministic.inputs, just like other scalar overrides. Currency is selected on a run with run(model, { currency }); it does not need to be declared as a model precondition.

A curve contains dated points:

Curves use step interpolation by default and also support linear. Read the value at the current period with ctx.get(price), or at an explicit date with ctx.curveAt(price, date).

In the Calculator, each curve appears in its own grouped editor. Add or remove dated points and select the interpolation method. The run result includes the effective curve points so the editor can preserve the model's original series until you change it.

For uncertainty, use input.normal, input.logNormal, input.uniform, or input.triangular. A deterministic run uses a central value: the mean for normal, expected value for log-normal, midpoint for uniform, and mode for triangular. Monte Carlo runs draw values instead.

Inputs are declared in the model. To override them with an inline run configuration, see Run one model with different inputs. In the Calculator, you can also create named input variations after the model's preconditions have been discovered; see Create scenarios in the Calculator.

Use input.object() and input.objectArray() when related values belong together, such as a list of household members. Nested scalar types keep validation and presentation metadata in the declaration; the Calculator renders object arrays as editable cards. See Declare allocations and fund needs.

Next: Work with currency and money.