Always set options_.{ramsey,discretionary}_policy at the preprocessor level
And set them before any computation is done. These fields should rather be in M_.master
parent
2f353a3c62
commit
70192aec71
|
@ -515,17 +515,12 @@ void
|
|||
RamseyModelStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
// options_.ramsey_policy indicates that a Ramsey model is present in the *.mod file
|
||||
// this affects the computation of the steady state that uses a special algorithm
|
||||
// It should probably rather be a M_ field, but we leave it in options_ for historical reason
|
||||
|
||||
// Ensure that order 3 implies k_order (#844)
|
||||
if (auto opt1 = options_list.get_if<OptionsList::NumVal>("order"),
|
||||
opt2 = options_list.get_if<OptionsList::NumVal>("k_order_solver");
|
||||
(opt2 && *opt2 == "true") || (opt1 && stoi(*opt1) >= 3))
|
||||
output << "options_.k_order_solver = true;" << endl;
|
||||
|
||||
output << "options_.ramsey_policy = true;" << endl;
|
||||
options_list.writeOutput(output);
|
||||
}
|
||||
|
||||
|
|
|
@ -892,11 +892,14 @@ ModFile::writeMOutput(const string &basename, bool clear_all, bool clear_global,
|
|||
<< "M_.heteroskedastic_shocks.Qvalue_orig = [];" << endl
|
||||
<< "M_.heteroskedastic_shocks.Qscale_orig = [];" << endl;
|
||||
|
||||
// NB: options_.{ramsey,discretionary}_policy should rather be fields of M_
|
||||
mOutputFile << boolalpha
|
||||
<< "options_.linear = " << linear << ";" << endl
|
||||
<< "options_.block = " << block << ";" << endl
|
||||
<< "options_.bytecode = " << bytecode << ";" << endl
|
||||
<< "options_.use_dll = " << use_dll << ";" << endl;
|
||||
<< "options_.use_dll = " << use_dll << ";" << endl
|
||||
<< "options_.ramsey_policy = " << (mod_file_struct.ramsey_model_present || mod_file_struct.ramsey_policy_present) << ";" << endl
|
||||
<< "options_.discretionary_policy = " << mod_file_struct.discretionary_policy_present << ";" << endl;
|
||||
|
||||
if (parallel_local_files.size() > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue