Fix “planner_discount” option of “discretionary_policy”

Since fe0c781c, the discount factor would
always be equal to one.

Ref. dynare#1699
parent 3fec11b1
Pipeline #3036 passed with stages
in 3 minutes and 49 seconds
......@@ -2222,14 +2222,20 @@ ParsingDriver::evaluate_planner_objective()
void
ParsingDriver::discretionary_policy()
{
/* The logic here is different from “ramsey_policy” and “ramsey_model”,
because we want to allow several instances of “discretionary_policy” in
the same .mod file. */
if (!mod_file->symbol_table.exists("optimal_policy_discount_factor"))
{
declare_parameter("optimal_policy_discount_factor");
init_param("optimal_policy_discount_factor", data_tree->One);
}
declare_parameter("optimal_policy_discount_factor");
if (!planner_discount)
planner_discount = data_tree->One;
init_param("optimal_policy_discount_factor", planner_discount);
mod_file->addStatement(make_unique<DiscretionaryPolicyStatement>(symbol_list, options_list));
symbol_list.clear();
options_list.clear();
planner_discount = nullptr;
}
void
......
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