You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default implementation had 2 variables to track inputs and outputs from sub-components:
vars A list of all variables either read by this object (i.e. arguments in an equation) or written by this object on the parent.
wvars: A list of variables written by this object on the parent.
There is a note in the source code in the base modelObject class in orderOperations() (see) that:
// @todo: rvars on subcomps are explicit independent inputs to subcomps that are not yet handled
// wvars are explicit outputs from subcomps that are often used by other comps
...
Some objecdts have begun to implement this, such as hydroImpSmall, but most others do not. For example: after the line $this->vars[] = $thisop; in the Equation class we should add $this->rvars[] = $thisop; to make the rvars a valid indicator of required inputs (see Code 1 below). We need to:
Insure that all sub-comps handle rvars separately in their parseOperands or other init() steps.
Code 1: The parseOperands() function in class Equation (see code here).
function parseOperands() {
$ops = array();
$arOperands = preg_split('/[\)\(\+\-\*\/\\^]/',$this->equation);
foreach ($arOperands as $thisop) {
$thisop = ltrim(rtrim($thisop));
if (!is_numeric($thisop) and (strlen($thisop) > 0)) {
# not numeric, must be a variable, not a constant
# check to see if it has been added already
if (!in_array($thisop, $this->vars)) {
$this->vars[] = $thisop;
}
}
}
}
The text was updated successfully, but these errors were encountered:
The default implementation had 2 variables to track inputs and outputs from sub-components:
vars
A list of all variables either read by this object (i.e. arguments in an equation) or written by this object on the parent.wvars
: A list of variables written by this object on the parent.There is a note in the source code in the base modelObject class in
orderOperations()
(see) that:Some objecdts have begun to implement this, such as
hydroImpSmall
, but most others do not. For example: after the line$this->vars[] = $thisop;
in the Equation class we should add$this->rvars[] = $thisop;
to make the rvars a valid indicator of required inputs (see Code 1 below). We need to:Code 1: The
parseOperands()
function in classEquation
(see code here).The text was updated successfully, but these errors were encountered: