Skip to content
Snippets Groups Projects
Verified Commit 7d1a467a authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Transform predetermined variables before computing original model leads/lags

This is necessary to correctly compute those original model leads/lags. In
particular, this is needed for correct interaction with “histval”.

Closes: #47
parent 2a048a48
No related branches found
No related tags found
No related merge requests found
......@@ -386,6 +386,8 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, bool
— except substituting out variables which we know are constant (they
appear in an equation of the form: X = constant)
— except adl operators which we always want expanded
— except predetermined variables (which must be handled before the call to
setLeadsLagsOrig(), see preprocessor#47)
— except diff operators with a lead which have been expanded by
DataTree:AddDiff()
*/
......@@ -393,6 +395,8 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, bool
dynamic_model.includeExcludeEquations(include_eqs, false);
dynamic_model.simplifyEquations();
dynamic_model.substituteAdl();
if (symbol_table.predeterminedNbr() > 0)
dynamic_model.transformPredeterminedVariables();
dynamic_model.setLeadsLagsOrig();
original_model = dynamic_model;
dynamic_model.expandEqTags();
......@@ -501,9 +505,6 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, bool
dynamic_model.addEquationsForVar();
if (symbol_table.predeterminedNbr() > 0)
dynamic_model.transformPredeterminedVariables();
// Create auxiliary vars for Expectation operator
dynamic_model.substituteExpectation(mod_file_struct.partial_information);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment