preprocessor: take care of extra exos in ramsey_model statement
parent
5b77bb817e
commit
afe123a79f
|
@ -293,6 +293,29 @@ RamseyModelStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsol
|
||||||
mod_file_struct.k_order_solver = true;
|
mod_file_struct.k_order_solver = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Statement *
|
||||||
|
RamseyModelStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table)
|
||||||
|
{
|
||||||
|
SymbolList new_symbol_list;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SymbolTable *new_symbol_table = dynamic_datatree.getSymbolTable();
|
||||||
|
vector<string> symbols = symbol_list.get_symbols();
|
||||||
|
for (vector<string>::const_iterator it = symbols.begin(); it != symbols.end(); it++)
|
||||||
|
{
|
||||||
|
new_symbol_table->getID(*it);
|
||||||
|
new_symbol_list.addSymbol(*it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (SymbolTable::UnknownSymbolNameException &e)
|
||||||
|
{
|
||||||
|
cerr << "ERROR: A variable in the ramsey_model 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 RamseyModelStatement(new_symbol_list, options_list);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RamseyModelStatement::writeOutput(ostream &output, const string &basename) const
|
RamseyModelStatement::writeOutput(ostream &output, const string &basename) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -122,6 +122,7 @@ public:
|
||||||
const OptionsList &options_list_arg);
|
const OptionsList &options_list_arg);
|
||||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||||
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 RamseyPolicyStatement : public Statement
|
class RamseyPolicyStatement : public Statement
|
||||||
|
|
Loading…
Reference in New Issue