preprocessor: take care of extra exos in observation_trends
parent
5d3753f466
commit
9fa6cb3bd1
|
@ -1181,6 +1181,29 @@ ObservationTrendsStatement::ObservationTrendsStatement(const trend_elements_t &t
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Statement *
|
||||||
|
ObservationTrendsStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table)
|
||||||
|
{
|
||||||
|
SymbolTable *new_symbol_table = dynamic_datatree.getSymbolTable();
|
||||||
|
map<string, expr_t> new_trend_elements;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (map<string, expr_t>::const_iterator it = trend_elements.begin();
|
||||||
|
it != trend_elements.end(); it++)
|
||||||
|
{
|
||||||
|
new_symbol_table->getID(it->first);
|
||||||
|
new_trend_elements[it->first] = it->second->cloneDynamicReindex(dynamic_datatree, orig_symbol_table);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
cerr << "ERROR: A variable in the observation_trends statement was not found in the symbol table" << endl
|
||||||
|
<< " This likely means that you have declared a varexo that is not used in the model" << endl;
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
return new ObservationTrendsStatement(new_trend_elements, *new_symbol_table);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ObservationTrendsStatement::writeOutput(ostream &output, const string &basename) const
|
ObservationTrendsStatement::writeOutput(ostream &output, const string &basename) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -222,6 +222,7 @@ public:
|
||||||
ObservationTrendsStatement(const trend_elements_t &trend_elements_arg,
|
ObservationTrendsStatement(const trend_elements_t &trend_elements_arg,
|
||||||
const SymbolTable &symbol_table_arg);
|
const SymbolTable &symbol_table_arg);
|
||||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||||
|
virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table);
|
||||||
};
|
};
|
||||||
|
|
||||||
class OsrParamsStatement : public Statement
|
class OsrParamsStatement : public Statement
|
||||||
|
|
Loading…
Reference in New Issue