2008-02-03 11:28:36 +01:00
|
|
|
/*
|
2023-01-16 15:02:50 +01:00
|
|
|
* Copyright © 2003-2023 Dynare Team
|
2008-02-03 11:28:36 +01:00
|
|
|
*
|
|
|
|
* This file is part of Dynare.
|
|
|
|
*
|
|
|
|
* Dynare is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Dynare is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-06-09 16:52:20 +02:00
|
|
|
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2008-02-03 11:28:36 +01:00
|
|
|
*/
|
|
|
|
|
2023-12-01 15:39:01 +01:00
|
|
|
#ifndef COMPUTING_TASKS_HH
|
|
|
|
#define COMPUTING_TASKS_HH
|
2008-02-03 11:28:36 +01:00
|
|
|
|
2023-12-01 14:59:20 +01:00
|
|
|
#include <memory>
|
2022-05-16 14:52:47 +02:00
|
|
|
#include <optional>
|
2023-11-30 15:28:57 +01:00
|
|
|
#include <ostream>
|
2008-02-03 11:28:36 +01:00
|
|
|
|
2009-04-30 15:14:33 +02:00
|
|
|
#include "DynamicModel.hh"
|
2018-09-03 17:16:28 +02:00
|
|
|
#include "ModelEquationBlock.hh"
|
2023-11-30 15:28:57 +01:00
|
|
|
#include "Statement.hh"
|
|
|
|
#include "StaticModel.hh"
|
|
|
|
#include "SymbolList.hh"
|
|
|
|
#include "SymbolTable.hh"
|
2008-02-03 11:28:36 +01:00
|
|
|
|
|
|
|
class SteadyStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SteadyStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CheckStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit CheckStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class SimulStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SimulStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2014-04-09 17:57:17 +02:00
|
|
|
class PerfectForesightSetupStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2014-04-09 17:57:17 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit PerfectForesightSetupStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2014-04-09 17:57:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class PerfectForesightSolverStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2014-04-09 17:57:17 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit PerfectForesightSolverStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2014-04-09 17:57:17 +02:00
|
|
|
};
|
|
|
|
|
2021-07-09 17:14:22 +02:00
|
|
|
class PerfectForesightWithExpectationErrorsSetupStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2021-07-09 17:14:22 +02:00
|
|
|
public:
|
|
|
|
explicit PerfectForesightWithExpectationErrorsSetupStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2021-07-09 17:14:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class PerfectForesightWithExpectationErrorsSolverStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2021-07-09 17:14:22 +02:00
|
|
|
public:
|
|
|
|
explicit PerfectForesightWithExpectationErrorsSolverStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2021-07-09 17:14:22 +02:00
|
|
|
};
|
|
|
|
|
2015-10-13 17:16:10 +02:00
|
|
|
class PriorPosteriorFunctionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2015-10-14 11:02:35 +02:00
|
|
|
const bool prior_func;
|
2015-10-13 17:16:10 +02:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2015-10-13 17:16:10 +02:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
PriorPosteriorFunctionStatement(const bool prior_func_arg, OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2015-10-13 17:16:10 +02:00
|
|
|
};
|
|
|
|
|
2008-08-29 14:31:25 +02:00
|
|
|
class ModelInfoStatement : public Statement
|
2008-08-25 17:06:36 +02:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-08-25 17:06:36 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit ModelInfoStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-08-25 17:06:36 +02:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class StochSimulStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2022-03-28 18:11:53 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
StochSimulStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2008-05-01 14:04:48 +02:00
|
|
|
class ForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-05-01 14:04:48 +02:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
ForecastStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2014-03-08 10:05:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class RamseyModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2014-03-08 10:05:25 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit RamseyModelStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-05-01 14:04:48 +02:00
|
|
|
};
|
|
|
|
|
2015-05-31 12:18:06 +02:00
|
|
|
class RamseyConstraintsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2017-06-01 19:58:32 +02:00
|
|
|
struct Constraint
|
|
|
|
{
|
2015-05-31 12:18:06 +02:00
|
|
|
int endo;
|
|
|
|
BinaryOpcode code;
|
|
|
|
expr_t expression;
|
2017-06-01 19:58:32 +02:00
|
|
|
};
|
2018-06-04 14:07:13 +02:00
|
|
|
using constraints_t = vector<Constraint>;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2015-05-31 12:18:06 +02:00
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
2015-05-31 12:18:06 +02:00
|
|
|
const constraints_t constraints;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2015-05-31 12:18:06 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
RamseyConstraintsStatement(const SymbolTable& symbol_table_arg, constraints_t constraints_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2015-05-31 12:18:06 +02:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class RamseyPolicyStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2019-12-19 14:48:55 +01:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
RamseyPolicyStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2021-12-03 13:17:34 +01:00
|
|
|
class EvaluatePlannerObjectiveStatement : public Statement
|
2019-12-12 11:28:07 +01:00
|
|
|
{
|
2021-12-03 13:17:34 +01:00
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2019-12-12 11:28:07 +01:00
|
|
|
public:
|
2022-03-01 12:15:03 +01:00
|
|
|
explicit EvaluatePlannerObjectiveStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2019-12-12 11:28:07 +01:00
|
|
|
};
|
|
|
|
|
2021-07-13 15:38:25 +02:00
|
|
|
class OccbinSetupStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2021-07-13 15:38:25 +02:00
|
|
|
public:
|
2022-03-01 12:15:03 +01:00
|
|
|
explicit OccbinSetupStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2021-07-13 15:38:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class OccbinSolverStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2021-07-13 15:38:25 +02:00
|
|
|
public:
|
2022-03-01 12:15:03 +01:00
|
|
|
explicit OccbinSolverStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2021-07-13 15:38:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class OccbinWriteRegimesStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2021-07-13 15:38:25 +02:00
|
|
|
public:
|
2022-03-01 12:15:03 +01:00
|
|
|
explicit OccbinWriteRegimesStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2021-07-13 15:38:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class OccbinGraphStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
2021-07-13 17:07:18 +02:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2021-07-13 15:38:25 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
OccbinGraphStatement(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;
|
2021-07-13 15:38:25 +02:00
|
|
|
};
|
|
|
|
|
2011-03-13 21:19:55 +01:00
|
|
|
class DiscretionaryPolicyStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2011-03-13 21:19:55 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
DiscretionaryPolicyStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-03-13 21:19:55 +01:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class RplotStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
RplotStatement(SymbolList symbol_list_arg, const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-11-20 20:16:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class UnitRootVarsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class DsampleStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const int val1, val2;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit DsampleStatement(int val1_arg);
|
2008-02-03 11:28:36 +01:00
|
|
|
DsampleStatement(int val1_arg, int val2_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class EstimationStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
EstimationStatement(const SymbolTable& symbol_table_arg, SymbolList symbol_list_arg,
|
2018-06-04 12:31:07 +02:00
|
|
|
OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2023-12-14 18:37:10 +01:00
|
|
|
class SensitivityStatement : public Statement
|
2008-02-03 11:28:36 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2023-12-14 18:37:10 +01:00
|
|
|
explicit SensitivityStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class ObservationTrendsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 14:31:26 +02:00
|
|
|
using trend_elements_t = map<string, expr_t>;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
private:
|
2010-09-16 19:00:48 +02:00
|
|
|
const trend_elements_t trend_elements;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
ObservationTrendsStatement(trend_elements_t trend_elements_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2020-06-29 11:38:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class DeterministicTrendsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
using trend_elements_t = map<string, expr_t>;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2020-06-29 11:38:41 +02:00
|
|
|
private:
|
|
|
|
const trend_elements_t trend_elements;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2020-06-29 11:38:41 +02:00
|
|
|
public:
|
|
|
|
DeterministicTrendsStatement(trend_elements_t trend_elements_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2021-01-18 16:42:20 +01:00
|
|
|
class FilterInitialStateStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
using filter_initial_state_elements_t = map<pair<int, int>, expr_t>;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2021-01-18 16:42:20 +01:00
|
|
|
private:
|
|
|
|
const filter_initial_state_elements_t filter_initial_state_elements;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2021-01-18 16:42:20 +01:00
|
|
|
public:
|
|
|
|
FilterInitialStateStatement(filter_initial_state_elements_t filter_initial_state_elements_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2021-01-18 16:42:20 +01:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class OsrParamsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
OsrParamsStatement(SymbolList symbol_list_arg, const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class OsrStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
OsrStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2016-05-10 18:01:00 +02:00
|
|
|
//! Temporary structure used when parsing estimation_params* statements
|
|
|
|
class OsrParams
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
string name;
|
|
|
|
expr_t low_bound, up_bound;
|
|
|
|
|
|
|
|
void
|
2023-11-30 15:28:57 +01:00
|
|
|
init(const DataTree& datatree)
|
2016-05-10 18:01:00 +02:00
|
|
|
{
|
|
|
|
name = "";
|
|
|
|
low_bound = datatree.MinusInfinity;
|
|
|
|
up_bound = datatree.Infinity;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OsrParamsBoundsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const vector<OsrParams> osr_params_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2016-05-10 18:01:00 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit OsrParamsBoundsStatement(vector<OsrParams> osr_params_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2016-05-10 18:01:00 +02:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class DynaTypeStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const string filename;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
DynaTypeStatement(SymbolList symbol_list_arg, string filename_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class DynaSaveStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const string filename;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
DynaSaveStatement(SymbolList symbol_list_arg, string filename_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class ModelComparisonStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 14:31:26 +02:00
|
|
|
using filename_list_t = vector<pair<string, string>>;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
private:
|
2010-09-16 19:00:48 +02:00
|
|
|
filename_list_t filename_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
ModelComparisonStatement(filename_list_t filename_list_arg, OptionsList options_list_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2009-01-22 16:05:38 +01:00
|
|
|
//! Temporary structure used when parsing estimation_params* statements
|
|
|
|
class EstimationParams
|
2008-02-03 11:28:36 +01:00
|
|
|
{
|
2009-01-22 16:05:38 +01:00
|
|
|
public:
|
2008-02-03 11:28:36 +01:00
|
|
|
int type;
|
2011-12-29 18:43:21 +01:00
|
|
|
string name, name2;
|
|
|
|
PriorDistributions prior;
|
2010-09-16 19:18:45 +02:00
|
|
|
expr_t init_val, low_bound, up_bound, mean, std, p3, p4, jscale;
|
2009-01-22 16:05:38 +01:00
|
|
|
|
2009-12-16 18:13:23 +01:00
|
|
|
void
|
2023-11-30 15:28:57 +01:00
|
|
|
init(const DataTree& datatree)
|
2008-02-03 11:28:36 +01:00
|
|
|
{
|
|
|
|
type = 0;
|
|
|
|
name = "";
|
|
|
|
name2 = "";
|
2018-07-18 16:52:12 +02:00
|
|
|
prior = PriorDistributions::noShape;
|
2009-01-22 16:05:38 +01:00
|
|
|
init_val = datatree.NaN;
|
|
|
|
low_bound = datatree.MinusInfinity;
|
|
|
|
up_bound = datatree.Infinity;
|
|
|
|
mean = datatree.NaN;
|
|
|
|
std = datatree.NaN;
|
|
|
|
p3 = datatree.NaN;
|
|
|
|
p4 = datatree.NaN;
|
|
|
|
jscale = datatree.NaN;
|
2008-02-03 11:28:36 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-09-08 16:38:15 +02:00
|
|
|
class AbstractEstimatedParamsStatement : public Statement
|
2008-02-03 11:28:36 +01:00
|
|
|
{
|
2021-09-08 16:38:15 +02:00
|
|
|
protected:
|
2008-02-03 11:28:36 +01:00
|
|
|
const vector<EstimationParams> estim_params_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
2021-09-08 16:38:15 +02:00
|
|
|
AbstractEstimatedParamsStatement(vector<EstimationParams> estim_params_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
2023-12-01 14:02:38 +01:00
|
|
|
[[nodiscard]] virtual string blockName() const = 0;
|
2021-12-15 15:59:18 +01:00
|
|
|
// Part of the check pass that is common to the three estimated_params{,_init,bounds} blocks
|
2021-09-08 16:38:15 +02:00
|
|
|
void commonCheckPass() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class EstimatedParamsStatement : public AbstractEstimatedParamsStatement
|
|
|
|
{
|
2021-12-16 14:22:31 +01:00
|
|
|
private:
|
|
|
|
const bool overwrite;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
EstimatedParamsStatement(vector<EstimationParams> estim_params_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg, bool overwrite_arg);
|
2023-12-01 14:02:38 +01:00
|
|
|
[[nodiscard]] string
|
2023-11-30 15:28:57 +01:00
|
|
|
blockName() const override
|
|
|
|
{
|
|
|
|
return "estimated_params";
|
|
|
|
};
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2021-09-08 16:38:15 +02:00
|
|
|
class EstimatedParamsInitStatement : public AbstractEstimatedParamsStatement
|
2008-02-03 11:28:36 +01:00
|
|
|
{
|
|
|
|
private:
|
2013-11-06 10:36:58 +01:00
|
|
|
const bool use_calibration;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
EstimatedParamsInitStatement(vector<EstimationParams> estim_params_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg, const bool use_calibration_arg);
|
2023-12-01 14:02:38 +01:00
|
|
|
[[nodiscard]] string
|
2023-11-30 15:28:57 +01:00
|
|
|
blockName() const override
|
|
|
|
{
|
|
|
|
return "estimated_params_init";
|
|
|
|
};
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2021-09-08 16:38:15 +02:00
|
|
|
class EstimatedParamsBoundsStatement : public AbstractEstimatedParamsStatement
|
2008-02-03 11:28:36 +01:00
|
|
|
{
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
EstimatedParamsBoundsStatement(vector<EstimationParams> estim_params_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
2023-12-01 14:02:38 +01:00
|
|
|
[[nodiscard]] string
|
2023-11-30 15:28:57 +01:00
|
|
|
blockName() const override
|
|
|
|
{
|
|
|
|
return "estimated_params_bounds";
|
|
|
|
};
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2021-12-15 15:59:18 +01:00
|
|
|
class EstimatedParamsRemoveStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Only the type, name and name2 fields of EstimationParams are used
|
|
|
|
const vector<EstimationParams> estim_params_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
2021-12-15 15:59:18 +01:00
|
|
|
EstimatedParamsRemoveStatement(vector<EstimationParams> estim_params_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2021-12-15 15:59:18 +01:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class OptimWeightsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 14:31:26 +02:00
|
|
|
using var_weights_t = map<string, expr_t>;
|
|
|
|
using covar_weights_t = map<pair<string, string>, expr_t>;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
private:
|
2010-09-16 19:00:48 +02:00
|
|
|
const var_weights_t var_weights;
|
|
|
|
const covar_weights_t covar_weights;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
OptimWeightsStatement(var_weights_t var_weights_arg, covar_weights_t covar_weights_arg,
|
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class PlannerObjectiveStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2023-12-01 14:59:20 +01:00
|
|
|
unique_ptr<PlannerObjective> model_tree;
|
2023-11-30 15:28:57 +01:00
|
|
|
bool computing_pass_called {false};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2023-12-01 14:59:20 +01:00
|
|
|
explicit PlannerObjectiveStatement(unique_ptr<PlannerObjective> model_tree_arg);
|
2008-02-03 11:28:36 +01:00
|
|
|
/*! \todo check there are only endogenous variables at the current period in the objective
|
|
|
|
(no exogenous, no lead/lag) */
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
2008-10-29 16:10:51 +01:00
|
|
|
/*! \todo allow for the possibility of disabling temporary terms */
|
2023-11-30 15:28:57 +01:00
|
|
|
void computingPass(const ModFileStructure& mod_file_struct) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2018-07-31 12:42:08 +02:00
|
|
|
//! Return a reference the Planner Objective model tree
|
2023-12-01 14:59:20 +01:00
|
|
|
[[nodiscard]] const PlannerObjective& getPlannerObjective() const;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class BVARDensityStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const int maxnlags;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
BVARDensityStatement(int maxnlags_arg, OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class BVARForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const int nlags;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
BVARForecastStatement(int nlags_arg, OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2023-09-08 15:35:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class BVARIRFStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const int nirf;
|
|
|
|
const string identificationname;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2023-09-08 15:35:43 +02:00
|
|
|
public:
|
|
|
|
BVARIRFStatement(int nirf_arg, string identificationname_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2009-07-26 19:07:07 +02:00
|
|
|
class SBVARStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-07-26 19:07:07 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SBVARStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-07-26 19:07:07 +02:00
|
|
|
};
|
|
|
|
|
2011-05-11 19:02:39 +02:00
|
|
|
class MSSBVAREstimationStatement : public Statement
|
2009-07-26 19:07:07 +02:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-07-26 19:07:07 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVAREstimationStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARSimulationStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2011-05-11 19:02:39 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARSimulationStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARComputeMDDStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2011-05-11 19:02:39 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARComputeMDDStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARComputeProbabilitiesStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2011-05-11 19:02:39 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARComputeProbabilitiesStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARIrfStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2011-05-30 15:47:34 +02:00
|
|
|
const SymbolList symbol_list;
|
2011-05-11 19:02:39 +02:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2011-05-11 19:02:39 +02:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
MSSBVARIrfStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2011-05-11 19:02:39 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARForecastStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARVarianceDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2011-05-11 19:02:39 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARVarianceDecompositionStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-07-26 19:07:07 +02:00
|
|
|
};
|
|
|
|
|
2009-04-20 15:58:15 +02:00
|
|
|
class IdentificationStatement : public Statement
|
|
|
|
{
|
2009-10-14 18:16:43 +02:00
|
|
|
private:
|
2011-04-20 12:13:30 +02:00
|
|
|
OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-04-20 15:58:15 +02:00
|
|
|
public:
|
2018-10-04 17:18:27 +02:00
|
|
|
explicit IdentificationStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-04-20 15:58:15 +02:00
|
|
|
};
|
|
|
|
|
2009-04-30 15:14:33 +02:00
|
|
|
class WriteLatexDynamicModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const DynamicModel& dynamic_model;
|
2017-04-04 15:28:27 +02:00
|
|
|
const bool write_equation_tags;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-04-30 15:14:33 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
WriteLatexDynamicModelStatement(const DynamicModel& dynamic_model_arg,
|
|
|
|
bool write_equation_tags_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-04-30 15:14:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class WriteLatexStaticModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const StaticModel& static_model;
|
2017-08-24 15:35:10 +02:00
|
|
|
const bool write_equation_tags;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-04-30 15:14:33 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
WriteLatexStaticModelStatement(const StaticModel& static_model_arg, bool write_equation_tags_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-04-30 15:14:33 +02:00
|
|
|
};
|
|
|
|
|
2015-02-16 08:31:30 +01:00
|
|
|
class WriteLatexOriginalModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const DynamicModel& original_model;
|
2017-08-24 15:35:10 +02:00
|
|
|
const bool write_equation_tags;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2015-02-16 08:31:30 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
WriteLatexOriginalModelStatement(const DynamicModel& original_model_arg,
|
|
|
|
bool write_equation_tags_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2015-02-16 08:31:30 +01:00
|
|
|
};
|
|
|
|
|
2017-08-30 11:32:01 +02:00
|
|
|
class WriteLatexSteadyStateModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const SteadyStateModel& steady_state_model;
|
|
|
|
|
2017-08-30 11:32:01 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
explicit WriteLatexSteadyStateModelStatement(const SteadyStateModel& steady_state_model_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2017-08-30 11:32:01 +02:00
|
|
|
};
|
|
|
|
|
2009-07-23 10:31:48 +02:00
|
|
|
class ShockDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2009-07-23 10:31:48 +02:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
ShockDecompositionStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-07-23 10:31:48 +02:00
|
|
|
};
|
|
|
|
|
2017-03-21 14:58:15 +01:00
|
|
|
class RealtimeShockDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2017-03-21 14:58:15 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
RealtimeShockDecompositionStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2017-03-22 11:30:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class PlotShockDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2017-03-22 11:30:35 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
PlotShockDecompositionStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2017-03-21 14:58:15 +01:00
|
|
|
};
|
2017-03-22 11:30:35 +01:00
|
|
|
|
2017-03-31 12:50:17 +02:00
|
|
|
class InitialConditionDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2017-03-31 12:50:17 +02:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
InitialConditionDecompositionStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2017-03-31 12:50:17 +02:00
|
|
|
};
|
|
|
|
|
2019-12-14 08:42:09 +01:00
|
|
|
class SqueezeShockDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2019-12-14 08:42:09 +01:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
SqueezeShockDecompositionStatement(SymbolList symbol_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2019-12-14 08:42:09 +01:00
|
|
|
};
|
|
|
|
|
2009-10-16 19:23:57 +02:00
|
|
|
class ConditionalForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-10-16 19:23:57 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit ConditionalForecastStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-10-16 19:23:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class PlotConditionalForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2022-05-16 14:52:47 +02:00
|
|
|
const optional<int> periods; // The user is allowed not to declare periods
|
2009-10-16 19:23:57 +02:00
|
|
|
const SymbolList symbol_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2009-10-16 19:23:57 +02:00
|
|
|
public:
|
2023-12-13 15:37:07 +01:00
|
|
|
PlotConditionalForecastStatement(const optional<int>& periods_arg, SymbolList symbol_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-10-16 19:23:57 +02:00
|
|
|
};
|
|
|
|
|
2012-05-30 16:28:00 +02:00
|
|
|
class CalibSmootherStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2012-05-30 16:28:00 +02:00
|
|
|
public:
|
2022-03-28 18:11:53 +02:00
|
|
|
CalibSmootherStatement(SymbolList symbol_list_arg, OptionsList options_list_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2012-05-30 16:28:00 +02:00
|
|
|
};
|
|
|
|
|
2012-06-08 17:36:32 +02:00
|
|
|
class ExtendedPathStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2012-06-08 17:36:32 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit ExtendedPathStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2012-06-08 17:36:32 +02:00
|
|
|
};
|
|
|
|
|
2009-12-04 22:32:19 +01:00
|
|
|
class SvarIdentificationStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 14:31:26 +02:00
|
|
|
// using svar_identification_exclusion_t = map<pair<int, int>, vector<int>>;
|
2011-10-10 11:45:55 +02:00
|
|
|
struct svar_identification_restriction
|
|
|
|
{
|
|
|
|
int equation;
|
|
|
|
int restriction_nbr;
|
|
|
|
int lag;
|
|
|
|
int variable;
|
|
|
|
expr_t value;
|
2017-06-01 19:58:32 +02:00
|
|
|
};
|
2011-10-10 11:45:55 +02:00
|
|
|
|
2018-06-04 14:07:13 +02:00
|
|
|
using svar_identification_restrictions_t = vector<svar_identification_restriction>;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-12-04 22:32:19 +01:00
|
|
|
private:
|
2011-10-10 11:45:55 +02:00
|
|
|
const svar_identification_restrictions_t restrictions;
|
2019-12-16 19:42:59 +01:00
|
|
|
const bool upper_cholesky_present, lower_cholesky_present, constants_exclusion_present;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
2023-12-01 14:02:38 +01:00
|
|
|
[[nodiscard]] int getMaxLag() const;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-12-04 22:32:19 +01:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
SvarIdentificationStatement(svar_identification_restrictions_t restrictions_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
bool upper_cholesky_present_arg, bool lower_cholesky_present_arg,
|
2018-10-04 17:18:27 +02:00
|
|
|
bool constants_exclusion_present_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-12-04 22:32:19 +01:00
|
|
|
};
|
|
|
|
|
2009-12-08 17:46:13 +01:00
|
|
|
class MarkovSwitchingStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2019-12-16 19:42:59 +01:00
|
|
|
map<pair<int, int>, double> restriction_map;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-12-08 17:46:13 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MarkovSwitchingStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-12-08 17:46:13 +01:00
|
|
|
};
|
|
|
|
|
2009-12-09 01:38:53 +01:00
|
|
|
class SvarStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2009-12-09 01:38:53 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SvarStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2009-12-09 01:38:53 +01:00
|
|
|
};
|
|
|
|
|
2015-08-24 11:21:06 +02:00
|
|
|
class SvarGlobalIdentificationCheckStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2015-08-24 11:21:06 +02:00
|
|
|
};
|
|
|
|
|
2011-11-29 17:14:26 +01:00
|
|
|
class SetTimeStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2011-11-29 17:14:26 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SetTimeStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-11-29 17:14:26 +01:00
|
|
|
};
|
|
|
|
|
2011-12-06 15:42:57 +01:00
|
|
|
class EstimationDataStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2011-12-06 15:42:57 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit EstimationDataStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-12-06 15:42:57 +01:00
|
|
|
};
|
|
|
|
|
2012-03-28 16:19:10 +02:00
|
|
|
class SubsamplesStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//! Storage for declaring subsamples: map<subsample_name, <date1, date2 >
|
2018-06-04 14:31:26 +02:00
|
|
|
using subsample_declaration_map_t = map<string, pair<string, string>>;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2012-03-28 16:19:10 +02:00
|
|
|
private:
|
2019-12-16 19:42:59 +01:00
|
|
|
const string name1, name2;
|
2012-03-28 16:19:10 +02:00
|
|
|
const subsample_declaration_map_t subsample_declaration_map;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2012-03-28 16:19:10 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
SubsamplesStatement(string name1_arg, string name2_arg,
|
2018-07-31 10:49:23 +02:00
|
|
|
subsample_declaration_map_t subsample_declaration_map_arg,
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2012-03-28 16:19:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class SubsamplesEqualStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2019-12-16 19:42:59 +01:00
|
|
|
const string to_name1, to_name2, from_name1, from_name2;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2012-03-28 16:19:10 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
SubsamplesEqualStatement(string to_name1_arg, string to_name2_arg, string from_name1_arg,
|
|
|
|
string from_name2_arg, const SymbolTable& symbol_table_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2012-03-28 16:19:10 +02:00
|
|
|
};
|
|
|
|
|
2015-03-03 15:08:33 +01:00
|
|
|
class JointPriorStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const vector<string> joint_parameters;
|
|
|
|
const PriorDistributions prior_shape;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutputHelper(ostream& output, const string& field, const string& lhs_field) const;
|
|
|
|
|
2015-03-03 15:08:33 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
JointPriorStatement(vector<string> joint_parameters_arg, PriorDistributions prior_shape_arg,
|
2018-06-04 12:31:07 +02:00
|
|
|
OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2015-03-03 15:08:33 +01:00
|
|
|
};
|
|
|
|
|
2011-12-11 15:35:26 +01:00
|
|
|
class BasicPriorStatement : public Statement
|
|
|
|
{
|
|
|
|
protected:
|
2019-12-16 19:42:59 +01:00
|
|
|
const string name, subsample_name;
|
2011-12-29 18:43:21 +01:00
|
|
|
const PriorDistributions prior_shape;
|
2011-12-11 15:35:26 +01:00
|
|
|
const expr_t variance;
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
BasicPriorStatement(string name_arg, string subsample_name_arg,
|
|
|
|
PriorDistributions prior_shape_arg, expr_t variance_arg,
|
2018-06-04 12:31:07 +02:00
|
|
|
OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void get_base_name(const SymbolType symb_type, string& lhs_field) const;
|
|
|
|
void writeCommonOutput(ostream& output, const string& lhs_field) const;
|
|
|
|
void writeCommonOutputHelper(ostream& output, const string& field, const string& lhs_field) const;
|
|
|
|
void writePriorOutput(ostream& output, string& lhs_field, const string& name2) const;
|
2023-12-01 14:02:38 +01:00
|
|
|
[[nodiscard]] bool is_structural_innovation(const SymbolType symb_type) const;
|
2023-11-30 15:28:57 +01:00
|
|
|
void writePriorIndex(ostream& output, const string& lhs_field) const;
|
|
|
|
void writeVarianceOption(ostream& output, const string& lhs_field) const;
|
|
|
|
void writeOutputHelper(ostream& output, const string& field, const string& lhs_field) const;
|
|
|
|
void writeShape(ostream& output, const string& lhs_field) const;
|
|
|
|
void writeJsonShape(ostream& output) const;
|
|
|
|
void writeJsonPriorOutput(ostream& output) const;
|
2011-12-11 15:35:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class PriorStatement : public BasicPriorStatement
|
|
|
|
{
|
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
PriorStatement(string name_arg, string subsample_name_arg, PriorDistributions prior_shape_arg,
|
|
|
|
expr_t variance_arg, OptionsList options_list_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-12-11 15:35:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class StdPriorStatement : public BasicPriorStatement
|
|
|
|
{
|
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2011-12-11 15:35:26 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
StdPriorStatement(string name_arg, string subsample_name_arg, PriorDistributions prior_shape_arg,
|
|
|
|
expr_t variance_arg, OptionsList options_list_arg,
|
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-12-11 15:35:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CorrPriorStatement : public BasicPriorStatement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const string name1;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2011-12-11 15:35:26 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
CorrPriorStatement(string name_arg1, string name_arg2, string subsample_name_arg,
|
|
|
|
PriorDistributions prior_shape_arg, expr_t variance_arg,
|
|
|
|
OptionsList options_list_arg, const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2012-03-30 14:55:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class PriorEqualStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2019-12-16 19:42:59 +01:00
|
|
|
const string to_declaration_type, to_name1, to_name2, to_subsample_name;
|
|
|
|
const string from_declaration_type, from_name1, from_name2, from_subsample_name;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
|
|
|
public:
|
|
|
|
PriorEqualStatement(string to_declaration_type_arg, string to_name1_arg, string to_name2_arg,
|
|
|
|
string to_subsample_name_arg, string from_declaration_type_arg,
|
|
|
|
string from_name1_arg, string from_name2_arg, string from_subsample_name_arg,
|
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void get_base_name(const SymbolType symb_type, string& lhs_field) const;
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-12-11 15:35:26 +01:00
|
|
|
};
|
2011-11-29 17:14:26 +01:00
|
|
|
|
2011-12-14 17:19:14 +01:00
|
|
|
class BasicOptionsStatement : public Statement
|
|
|
|
{
|
|
|
|
protected:
|
2019-12-16 19:42:59 +01:00
|
|
|
const string name, subsample_name;
|
2011-12-14 17:19:14 +01:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
BasicOptionsStatement(string name_arg, string subsample_name_arg, OptionsList options_list_arg);
|
|
|
|
void get_base_name(const SymbolType symb_type, string& lhs_field) const;
|
|
|
|
void writeOptionsOutput(ostream& output, string& lhs_field, const string& name2) const;
|
|
|
|
void writeCommonOutput(ostream& output, const string& lhs_field) const;
|
|
|
|
void writeCommonOutputHelper(ostream& output, const string& field, const string& lhs_field) const;
|
2023-12-01 14:02:38 +01:00
|
|
|
[[nodiscard]] bool is_structural_innovation(const SymbolType symb_type) const;
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOptionsIndex(ostream& output, const string& lhs_field) const;
|
|
|
|
void writeOutputHelper(ostream& output, const string& field, const string& lhs_field) const;
|
|
|
|
void writeJsonOptionsOutput(ostream& output) const;
|
2011-12-14 17:19:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class OptionsStatement : public BasicOptionsStatement
|
|
|
|
{
|
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
OptionsStatement(string name_arg, string subsample_name_arg, OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-12-14 17:19:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class StdOptionsStatement : public BasicOptionsStatement
|
|
|
|
{
|
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2011-12-14 17:19:14 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
StdOptionsStatement(string name_arg, string subsample_name_arg, OptionsList options_list_arg,
|
|
|
|
const SymbolTable& symbol_table_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-12-14 17:19:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CorrOptionsStatement : public BasicOptionsStatement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const string name1;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2011-12-14 17:19:14 +01:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
CorrOptionsStatement(string name_arg1, string name_arg2, string subsample_name_arg,
|
|
|
|
OptionsList options_list_arg, const SymbolTable& symbol_table_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2011-12-14 17:19:14 +01:00
|
|
|
};
|
|
|
|
|
2012-03-30 15:36:58 +02:00
|
|
|
class OptionsEqualStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2019-12-16 19:42:59 +01:00
|
|
|
const string to_declaration_type, to_name1, to_name2, to_subsample_name;
|
|
|
|
const string from_declaration_type, from_name1, from_name2, from_subsample_name;
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
|
|
|
public:
|
|
|
|
OptionsEqualStatement(string to_declaration_type_arg, string to_name1_arg, string to_name2_arg,
|
|
|
|
string to_subsample_name_arg, string from_declaration_type_arg,
|
|
|
|
string from_name1_arg, string from_name2_arg,
|
|
|
|
string from_subsample_name_arg, const SymbolTable& symbol_table_arg);
|
|
|
|
void get_base_name(const SymbolType symb_type, string& lhs_field) const;
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2012-03-30 15:36:58 +02:00
|
|
|
};
|
|
|
|
|
2012-11-16 12:34:49 +01:00
|
|
|
class ModelDiagnosticsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2012-11-16 12:34:49 +01:00
|
|
|
};
|
|
|
|
|
2014-04-03 15:05:20 +02:00
|
|
|
class Smoother2histvalStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2014-04-03 15:05:20 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit Smoother2histvalStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2014-04-03 15:05:20 +02:00
|
|
|
};
|
|
|
|
|
2020-07-08 18:42:14 +02:00
|
|
|
class MethodOfMomentsStatement : public Statement
|
2017-10-05 15:09:04 +02:00
|
|
|
{
|
2023-11-30 15:28:57 +01:00
|
|
|
private:
|
2017-10-05 15:09:04 +02:00
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2017-10-05 15:09:04 +02:00
|
|
|
public:
|
2022-03-01 12:15:03 +01:00
|
|
|
explicit MethodOfMomentsStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2017-10-05 15:09:04 +02:00
|
|
|
};
|
|
|
|
|
2017-10-06 14:49:14 +02:00
|
|
|
class GenerateIRFsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
const vector<string> generate_irf_names;
|
2018-06-04 14:17:36 +02:00
|
|
|
const vector<map<string, double>> generate_irf_elements;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2017-10-06 14:49:14 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
GenerateIRFsStatement(OptionsList options_list_arg, vector<string> generate_irf_names_arg,
|
2018-06-04 14:17:36 +02:00
|
|
|
vector<map<string, double>> generate_irf_elements_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2017-10-06 14:49:14 +02:00
|
|
|
};
|
|
|
|
|
2020-07-28 18:29:45 +02:00
|
|
|
class MatchedMomentsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2023-11-30 15:28:57 +01:00
|
|
|
const SymbolTable& symbol_table;
|
|
|
|
|
2020-07-28 18:29:45 +02:00
|
|
|
public:
|
|
|
|
/* Each moment is represented by a three vectors: symb_ids, lags, powers.
|
|
|
|
See the definition of ExprNode::matchMatchedMoment() for more details */
|
|
|
|
const vector<tuple<vector<int>, vector<int>, vector<int>>> moments;
|
2023-11-30 15:28:57 +01:00
|
|
|
MatchedMomentsStatement(const SymbolTable& symbol_table_arg,
|
2020-07-28 18:29:45 +02:00
|
|
|
vector<tuple<vector<int>, vector<int>, vector<int>>> moments_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2020-07-28 18:29:45 +02:00
|
|
|
};
|
|
|
|
|
2021-07-15 16:24:21 +02:00
|
|
|
class OccbinConstraintsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2021-07-21 16:16:39 +02:00
|
|
|
DataTree data_tree;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2021-07-15 16:24:21 +02:00
|
|
|
public:
|
2023-11-30 15:28:57 +01:00
|
|
|
// The tuple is (name, bind, relax, error_bind, error_relax) (where relax and error_{bind,relax}
|
|
|
|
// can be nullptr)
|
|
|
|
const vector<tuple<string, BinaryOpNode*, BinaryOpNode*, expr_t, expr_t>> constraints;
|
|
|
|
OccbinConstraintsStatement(
|
|
|
|
const DataTree& data_tree_arg,
|
|
|
|
vector<tuple<string, BinaryOpNode*, BinaryOpNode*, expr_t, expr_t>> constraints_arg);
|
|
|
|
void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override;
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2021-07-15 16:24:21 +02:00
|
|
|
};
|
|
|
|
|
2022-03-01 12:29:21 +01:00
|
|
|
class ResidStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2023-11-30 15:28:57 +01:00
|
|
|
|
2022-03-01 12:29:21 +01:00
|
|
|
public:
|
|
|
|
explicit ResidStatement(OptionsList options_list_arg);
|
2023-11-30 15:28:57 +01:00
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
2022-03-01 12:29:21 +01:00
|
|
|
};
|
|
|
|
|
2023-12-19 16:09:41 +01:00
|
|
|
class MatchedIrfsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// (endo name, exo name) → vector of (period start, period end, value, weight)
|
|
|
|
using matched_irfs_t = map<pair<string, string>, vector<tuple<int, int, expr_t, expr_t>>>;
|
|
|
|
MatchedIrfsStatement(matched_irfs_t values_weights_arg, bool overwrite_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const matched_irfs_t values_weights;
|
|
|
|
const bool overwrite;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MatchedIrfsWeightsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/* (endo1 name, period index or range for endo1, exo1 name, endo2 name, period index or range for
|
|
|
|
endo2, exo2 name) → weight */
|
|
|
|
using matched_irfs_weights_t = map<tuple<string, string, string, string, string, string>, expr_t>;
|
|
|
|
MatchedIrfsWeightsStatement(matched_irfs_weights_t weights_arg, bool overwrite_arg);
|
|
|
|
void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream& output) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const matched_irfs_weights_t weights;
|
|
|
|
const bool overwrite;
|
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
#endif
|