n2a icon indicating copy to clipboard operation
n2a copied to clipboard

$n is sometimes incorrectly tagged as constant

Open frothga opened this issue 7 years ago • 0 comments

$n may be expressed as a constant (eg: $n=17) or initOnly, but actually change due to structural dynamics, such as from $p or $type. This becomes a problem if other equations depend on the current value of $n. (If $n has no users, it doesn't matter.) The simplest solution is to always assume $n is dynamic, but this is inefficient.

The difficulty is that constants are analyzed early, before $p and $type. Yet we need to know about $p and $type to determine if $n is a constant (and thus whether equations that depend on $n are constants).

Notes on EquationSet: need to retag $n as early as possible in analysis depends on resolveRHS(), findDeath() and canGrow() canGrow() has no dependencies, and resolveRHS() is early need to move findDeath() as early as possible

frothga avatar Jan 23 '18 16:01 frothga