steady_state_model: authorizing change in parameter values in steady_state_model block + removing ys_ initialization to zero

issue#70
Michel Juillard 2010-06-03 15:59:35 +02:00
parent 743db26cb4
commit 851dcc88a6
2 changed files with 4 additions and 4 deletions

View File

@ -1866,7 +1866,7 @@ ParsingDriver::add_steady_state_model_equal(string *varname, NodeID expr)
}
SymbolType type = mod_file->symbol_table.getType(id);
if (type != eEndogenous && type != eModFileLocalVariable)
if (type != eEndogenous && type != eModFileLocalVariable && type != eParameter)
error(*varname + " has incorrect type");
mod_file->steady_state_model.addDefinition(id, expr);

View File

@ -31,7 +31,8 @@ void
SteadyStateModel::addDefinition(int symb_id, NodeID expr)
{
assert(symbol_table.getType(symb_id) == eEndogenous
|| symbol_table.getType(symb_id) == eModFileLocalVariable);
|| symbol_table.getType(symb_id) == eModFileLocalVariable
|| symbol_table.getType(symb_id) == eParameter);
// Add the variable
recursive_order.push_back(symb_id);
@ -93,8 +94,7 @@ SteadyStateModel::writeSteadyStateFile(const string &basename, bool ramsey_polic
output << "ys_orig_";
output << ", exo_)" << endl
<< "% Steady state generated by Dynare preprocessor" << endl
<< " global M_" << endl
<< " ys_=zeros(" << symbol_table.orig_endo_nbr() << ",1);" << endl;
<< " global M_" << endl;
for(size_t i = 0; i < recursive_order.size(); i++)
{