-
Notifications
You must be signed in to change notification settings - Fork 1
SizeUpperbound
Note: this property will be available in GeoDMS 20.10.0 or later.
With the SizeUpperbound property a modeller declares a sound upper bound on the number of elements of a domain unit whose count is not yet known, as a calculation rule that is much cheaper to evaluate than the actual count.
SizeUpperbound = "expression", configured on a domain unit, declares that the element count of the unit will not exceed the value of expression. The expression must result in a single numeric value (a parameter, so with a void domain). Keep it cheap: reference only parameters, counts of source domains, or simple aggregates of small, already available data.
The GeoDMS plans calculations before their results exist; resource-aware scheduling estimates how much memory each operation will claim. When a unit's data is ready, its count is known exactly and any declaration is ignored. When it is not, the engine derives what it can from the calculation rules — but for data-dependent cardinalities such as subsets and sparse origin–destination matrices, what can be derived (for instance #origins × #destinations) is far too pessimistic, while the modeller knows a realistic ceiling.
A declared SizeUpperbound supersedes what the engine would otherwise assume or derive, and is trusted for planning: the admission gate may reserve memory based on it. It is a planning aid only — a bound that is exceeded in practice degrades scheduling quality, but never invalidates any calculated result.
If a SizeExpectation is declared as well, the expectation provides the expected size (used for ordering the work) while the SizeUpperbound remains the reservable bound: the two properties compose. Most models that declare anything will want only the bound.
unit<uint32> ODpairs := select_uni(within_reach)
, SizeUpperbound = "#origins * MaxDestsPerOrigin";
The selection ranges over all origin–destination combinations, so the derivable ceiling would be #origins × #destinations. The declaration replaces it with the much smaller sparse ceiling, at the cost of one cheap multiplication.
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.