Commit 075837b2 authored by MichelJuillard's avatar MichelJuillard
Browse files

renamed ramsey_policy_discount_factor by optimal_policy_discount_factor...

renamed ramsey_policy_discount_factor by optimal_policy_discount_factor because it is also used by discretionary_policy
parent 6f1c0276
......@@ -3053,8 +3053,8 @@ DynamicModel::computeRamseyPolicyFOCs(const StaticModel &static_model)
}
// Get Discount Factor
assert(symbol_table.exists("ramsey_policy_discount_factor"));
int symb_id = symbol_table.getID("ramsey_policy_discount_factor");
assert(symbol_table.exists("optimal_policy_discount_factor"));
int symb_id = symbol_table.getID("optimal_policy_discount_factor");
assert(symbol_table.getType(symb_id) == eParameter);
expr_t discount_factor_node = AddVariable(symb_id, 0);
......
......@@ -1890,7 +1890,7 @@ o_plot_priors: PLOT_PRIORS EQUAL INT_NUMBER {driver.option_num("plot_priors", $3
o_aim_solver: AIM_SOLVER {driver.option_num("aim_solver", "1"); };
o_partial_information : PARTIAL_INFORMATION {driver.option_num("partial_information", "1"); };
o_planner_discount : PLANNER_DISCOUNT EQUAL expression { driver.declare_ramsey_policy_discount_factor_parameter($3); };
o_planner_discount : PLANNER_DISCOUNT EQUAL expression { driver.declare_optimal_policy_discount_factor_parameter($3); };
o_bvar_prior_tau : BVAR_PRIOR_TAU EQUAL signed_number { driver.option_num("bvar_prior_tau", $3); };
o_bvar_prior_decay : BVAR_PRIOR_DECAY EQUAL non_negative_number { driver.option_num("bvar_prior_decay", $3); };
......
......@@ -167,14 +167,14 @@ ParsingDriver::declare_parameter(string *name, string *tex_name)
}
void
ParsingDriver::declare_ramsey_policy_discount_factor_parameter(expr_t exprnode)
ParsingDriver::declare_optimal_policy_discount_factor_parameter(expr_t exprnode)
{
string *ramseyParName_declare = new string("ramsey_policy_discount_factor");
string *ramseyParName_init = new string("ramsey_policy_discount_factor");
if (mod_file->symbol_table.exists(*ramseyParName_declare))
error("Symbol ramsey_policy_discount_factor is needed by Dynare when using a ramsey_policy Statement");
declare_parameter(ramseyParName_declare, NULL);
init_param(ramseyParName_init, exprnode);
string *optimalParName_declare = new string("optimal_policy_discount_factor");
string *optimalParName_init = new string("optimal_policy_discount_factor");
if (mod_file->symbol_table.exists(*optimalParName_declare))
error("Symbol optimal_policy_discount_factor is needed by Dynare when using an ramsey_policy or a discretionary_policy statement");
declare_parameter(optimalParName_declare, NULL);
init_param(optimalParName_init, exprnode);
}
void
......@@ -1261,8 +1261,8 @@ ParsingDriver::end_planner_objective(expr_t expr)
void
ParsingDriver::ramsey_policy()
{
if (!mod_file->symbol_table.exists("ramsey_policy_discount_factor"))
declare_ramsey_policy_discount_factor_parameter(data_tree->One);
if (!mod_file->symbol_table.exists("optimal_policy_discount_factor"))
declare_optimal_policy_discount_factor_parameter(data_tree->One);
mod_file->addStatement(new RamseyPolicyStatement(symbol_list, options_list));
symbol_list.clear();
options_list.clear();
......@@ -1271,6 +1271,8 @@ ParsingDriver::ramsey_policy()
void
ParsingDriver::discretionary_policy()
{
if (!mod_file->symbol_table.exists("optimal_policy_discount_factor"))
declare_optimal_policy_discount_factor_parameter(data_tree->One);
mod_file->addStatement(new DiscretionaryPolicyStatement(symbol_list, options_list));
symbol_list.clear();
options_list.clear();
......
......@@ -213,8 +213,8 @@ public:
void declare_exogenous_det(string *name, string *tex_name = NULL);
//! Declares a parameter
void declare_parameter(string *name, string *tex_name = NULL);
//! Declares declare_ramsey_policy_discount_factor as a parameter and initializes it to exprnode
void declare_ramsey_policy_discount_factor_parameter(expr_t exprnode);
//! Declares declare_optimal_policy_discount_factor as a parameter and initializes it to exprnode
void declare_optimal_policy_discount_factor_parameter(expr_t exprnode);
//! Adds a predetermined_variable
void add_predetermined_variable(string *name);
//! Declares and initializes a local parameter
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment