Commit 7392cd3a authored by Houtan Bastani's avatar Houtan Bastani

add JSON output for plot_shock_decomposition, realtime_shock_decomposition,...

add JSON output for plot_shock_decomposition, realtime_shock_decomposition, and initial_condition_decomposition
parent 3947903f
......@@ -2827,6 +2827,23 @@ RealtimeShockDecompositionStatement::writeOutput(ostream &output, const string &
output << "oo_ = realtime_shock_decomposition(M_,oo_,options_,var_list_,bayestopt_,estim_params_);" << endl;
}
void
RealtimeShockDecompositionStatement::writeJsonOutput(ostream &output) const
{
output << R"({"statementName": "realtime_shock_decomposition")";
if (options_list.getNumberOfOptions())
{
output << ", ";
options_list.writeJsonOutput(output);
}
if (!symbol_list.empty())
{
output << ", ";
symbol_list.writeJsonOutput(output);
}
output << "}";
}
PlotShockDecompositionStatement::PlotShockDecompositionStatement(SymbolList symbol_list_arg,
OptionsList options_list_arg) :
symbol_list{move(symbol_list_arg)},
......@@ -2843,6 +2860,23 @@ PlotShockDecompositionStatement::writeOutput(ostream &output, const string &base
output << "plot_shock_decomposition(M_, oo_, options_, var_list_);" << endl;
}
void
PlotShockDecompositionStatement::writeJsonOutput(ostream &output) const
{
output << R"({"statementName": "plot_shock_decomposition")";
if (options_list.getNumberOfOptions())
{
output << ", ";
options_list.writeJsonOutput(output);
}
if (!symbol_list.empty())
{
output << ", ";
symbol_list.writeJsonOutput(output);
}
output << "}";
}
InitialConditionDecompositionStatement::InitialConditionDecompositionStatement(SymbolList symbol_list_arg,
OptionsList options_list_arg) :
symbol_list{move(symbol_list_arg)},
......@@ -2859,6 +2893,23 @@ InitialConditionDecompositionStatement::writeOutput(ostream &output, const strin
output << "oo_ = initial_condition_decomposition(M_, oo_, options_, var_list_, bayestopt_, estim_params_);" << endl;
}
void
InitialConditionDecompositionStatement::writeJsonOutput(ostream &output) const
{
output << R"({"statementName": "initial_condition_decomposition")";
if (options_list.getNumberOfOptions())
{
output << ", ";
options_list.writeJsonOutput(output);
}
if (!symbol_list.empty())
{
output << ", ";
symbol_list.writeJsonOutput(output);
}
output << "}";
}
ConditionalForecastStatement::ConditionalForecastStatement(OptionsList options_list_arg) :
options_list{move(options_list_arg)}
{
......
......@@ -727,6 +727,7 @@ public:
RealtimeShockDecompositionStatement(SymbolList symbol_list_arg,
OptionsList options_list_arg);
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class PlotShockDecompositionStatement : public Statement
......@@ -738,6 +739,7 @@ public:
PlotShockDecompositionStatement(SymbolList symbol_list_arg,
OptionsList options_list_arg);
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class InitialConditionDecompositionStatement : public Statement
......@@ -749,6 +751,7 @@ public:
InitialConditionDecompositionStatement(SymbolList symbol_list_arg,
OptionsList options_list_arg);
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class ConditionalForecastStatement : public Statement
......
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