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 ALLOCATE AVAILABLE function requires a special second argument that uses the first element of the priority profile to indicate the entire array. This special arrangement avoids giving the full dimension name in the argument, which would then require the dimension name to appear on the LHS. Like Vensim, SDEverywhere references all elements of the priority profile based on the first element. But this results in the first element alone being listed as a reference. For instance, the command:
sde generate --list models/allocate/allocate
includes this among the references for the shipments[region] variable:
_priority_vector[_region,_ptype]
The ptype and pextra elements are constants by convention and so are not needed in the references. However, the ppriority and pwidth elements are needed as references. This happens to not be an issue in our small test model, but puts dependencies out of order in a larger model.
The text was updated successfully, but these errors were encountered:
We need to rewrite the references for an ALLOCATE AVAILABLE variable when they are generated in EquationReader. Drop the ptype reference, but use its subscript family to find the ppriority and pwidth index names. Splice them into the original reference to derive the correct references. The listing for allocate.mdl now contains these references:
I also corrected a mistake in the _ALLOCATE_AVAILBLE C function. The initial x value in the search should be in the midpoint of the mean extremes, but the calculation of this was wrong.
The
ALLOCATE AVAILABLE
function requires a special second argument that uses the first element of the priority profile to indicate the entire array. This special arrangement avoids giving the full dimension name in the argument, which would then require the dimension name to appear on the LHS. Like Vensim, SDEverywhere references all elements of the priority profile based on the first element. But this results in the first element alone being listed as a reference. For instance, the command:includes this among the references for the
shipments[region]
variable:The
ptype
andpextra
elements are constants by convention and so are not needed in the references. However, theppriority
andpwidth
elements are needed as references. This happens to not be an issue in our small test model, but puts dependencies out of order in a larger model.The text was updated successfully, but these errors were encountered: