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

endval(learnt_in=…) block: fix treatment of unused endogenous variables

parent 46a85644
No related branches found
No related tags found
No related merge requests found
...@@ -333,6 +333,8 @@ EndValLearntInStatement::writeOutput(ostream &output, const string &basename, bo ...@@ -333,6 +333,8 @@ EndValLearntInStatement::writeOutput(ostream &output, const string &basename, bo
output << "M_.learnt_endval = [ M_.learnt_endval;" << endl; output << "M_.learnt_endval = [ M_.learnt_endval;" << endl;
for (auto [type, symb_id, value] : learnt_end_values) for (auto [type, symb_id, value] : learnt_end_values)
{ {
if (symbol_table.getType(symb_id) == SymbolType::unusedEndogenous) // See #82
continue;
output << "struct('learnt_in'," << learnt_in_period output << "struct('learnt_in'," << learnt_in_period
<< ",'exo_id'," << symbol_table.getTypeSpecificID(symb_id)+1 << ",'exo_id'," << symbol_table.getTypeSpecificID(symb_id)+1
<< ",'type','" << typeToString(type) << "'" << ",'type','" << typeToString(type) << "'"
...@@ -352,6 +354,8 @@ EndValLearntInStatement::writeJsonOutput(ostream &output) const ...@@ -352,6 +354,8 @@ EndValLearntInStatement::writeJsonOutput(ostream &output) const
it != learnt_end_values.end(); ++it) it != learnt_end_values.end(); ++it)
{ {
auto [type, symb_id, value] = *it; auto [type, symb_id, value] = *it;
if (symbol_table.getType(symb_id) == SymbolType::unusedEndogenous) // See #82
continue;
if (it != learnt_end_values.begin()) if (it != learnt_end_values.begin())
output << ", "; output << ", ";
output << R"({"name": ")" << symbol_table.getName(symb_id) << R"(", )" output << R"({"name": ")" << symbol_table.getName(symb_id) << R"(", )"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment