rename model__ to model
parent
ba8518bf43
commit
601a52a093
38
ModFile.cc
38
ModFile.cc
|
@ -1086,31 +1086,31 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
|
|||
<< "using Utils" << endl
|
||||
<< "using " << basename << "Static" << endl
|
||||
<< "using " << basename << "Dynamic" << endl << endl
|
||||
<< "export model__" << endl << endl
|
||||
<< "export model" << endl << endl
|
||||
<< "options = dynare_options()" << endl
|
||||
<< "options.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl << endl
|
||||
<< "model__ = model()" << endl
|
||||
<< "model__.fname = \"" << basename << "\"" << endl
|
||||
<< "model__.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl
|
||||
<< "model__.sigma_e = zeros(Float64, " << symbol_table.exo_nbr() << ", "
|
||||
<< "model = dynare_model()" << endl
|
||||
<< "model.fname = \"" << basename << "\"" << endl
|
||||
<< "model.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl
|
||||
<< "model.sigma_e = zeros(Float64, " << symbol_table.exo_nbr() << ", "
|
||||
<< symbol_table.exo_nbr() << ")" << endl
|
||||
<< "model__.sigma_e_is_diagonal = 1;" << endl
|
||||
<< "model__.correlation_matrix = ones(Float64, " << symbol_table.exo_nbr() << ", "
|
||||
<< "model.sigma_e_is_diagonal = 1;" << endl
|
||||
<< "model.correlation_matrix = ones(Float64, " << symbol_table.exo_nbr() << ", "
|
||||
<< symbol_table.exo_nbr() << ")" << endl
|
||||
<< "model__.orig_eq_nbr = " << orig_eqn_nbr << endl
|
||||
<< "model__.eq_nbr = " << dynamic_model.equation_number() << endl
|
||||
<< "model__.ramsey_eq_nbr = " << ramsey_eqn_nbr << endl;
|
||||
<< "model.orig_eq_nbr = " << orig_eqn_nbr << endl
|
||||
<< "model.eq_nbr = " << dynamic_model.equation_number() << endl
|
||||
<< "model.ramsey_eq_nbr = " << ramsey_eqn_nbr << endl;
|
||||
|
||||
if (mod_file_struct.calibrated_measurement_errors)
|
||||
jlOutputFile << "model__.h = zeros(Float64,"
|
||||
jlOutputFile << "model.h = zeros(Float64,"
|
||||
<< symbol_table.observedVariablesNbr() << ", "
|
||||
<< symbol_table.observedVariablesNbr() << ");" << endl
|
||||
<< "model__.correlation_matrix_me = ones(Float64, "
|
||||
<< "model.correlation_matrix_me = ones(Float64, "
|
||||
<< symbol_table.observedVariablesNbr() << ", "
|
||||
<< symbol_table.observedVariablesNbr() << ");" << endl;
|
||||
else
|
||||
jlOutputFile << "model__.h = zeros(Float64, 1, 1)" << endl
|
||||
<< "model__.correlation_matrix_me = ones(Float64, 1, 1)" << endl;
|
||||
jlOutputFile << "model.h = zeros(Float64, 1, 1)" << endl
|
||||
<< "model.correlation_matrix_me = ones(Float64, 1, 1)" << endl;
|
||||
|
||||
cout << "Processing outputs ..." << endl;
|
||||
symbol_table.writeJuliaOutput(jlOutputFile);
|
||||
|
@ -1128,23 +1128,23 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
|
|||
}
|
||||
steady_state_model.writeSteadyStateFile(basename, mod_file_struct.ramsey_model_present, true);
|
||||
|
||||
jlOutputFile << "model__.static = " << basename << "Static.getStaticFunction()" << endl
|
||||
<< "model__.dynamic = " << basename << "Dynamic.getDynamicFunction()" << endl
|
||||
jlOutputFile << "model.static = " << basename << "Static.getStaticFunction()" << endl
|
||||
<< "model.dynamic = " << basename << "Dynamic.getDynamicFunction()" << endl
|
||||
<< "try" << endl
|
||||
<< " using " << basename << "StaticParamsDerivs" << endl
|
||||
<< " model__.static_params_derivs = " << basename
|
||||
<< " model.static_params_derivs = " << basename
|
||||
<< "StaticParamsDerivs.params_derivs" << endl
|
||||
<< "catch" << endl
|
||||
<< "end" << endl
|
||||
<< "try" << endl
|
||||
<< " using " << basename << "DynamicParamsDerivs" << endl
|
||||
<< " model__.dynamic_params_derivs = " << basename
|
||||
<< " model.dynamic_params_derivs = " << basename
|
||||
<< "DynamicParamsDerivs.params_derivs" << endl
|
||||
<< "catch" << endl
|
||||
<< "end" << endl
|
||||
<< "try" << endl
|
||||
<< " using " << basename << "SteadyState2" << endl
|
||||
<< " model__.steady_state = " << basename << "SteadyState2.steady_state" << endl
|
||||
<< " model.steady_state = " << basename << "SteadyState2.steady_state" << endl
|
||||
<< "catch" << endl
|
||||
<< "end" << endl
|
||||
<< "end" << endl;
|
||||
|
|
|
@ -726,40 +726,40 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
|||
throw NotYetFrozenException();
|
||||
|
||||
output << "# Endogenous Variables" << endl
|
||||
<< "model__.endo = [" << endl;
|
||||
<< "model.endo = [" << endl;
|
||||
if (endo_nbr() > 0)
|
||||
for (int id = 0; id < endo_nbr(); id++)
|
||||
output << " DynareModel.Endo(\""
|
||||
output << " DynareModel.Endo(\""
|
||||
<< getName(endo_ids[id]) << "\", \""
|
||||
<< getTeXName(endo_ids[id]) << "\", \""
|
||||
<< getLongName(endo_ids[id]) << "\")" << endl;
|
||||
output << " ]" << endl;
|
||||
output << " ]" << endl;
|
||||
|
||||
output << "# Exogenous Variables" << endl
|
||||
<< "model__.exo = [" << endl;
|
||||
<< "model.exo = [" << endl;
|
||||
if (exo_nbr() > 0)
|
||||
for (int id = 0; id < exo_nbr(); id++)
|
||||
output << " DynareModel.Exo(\""
|
||||
output << " DynareModel.Exo(\""
|
||||
<< getName(exo_ids[id]) << "\", \""
|
||||
<< getTeXName(exo_ids[id]) << "\", \""
|
||||
<< getLongName(exo_ids[id]) << "\")" << endl;
|
||||
output << " ]" << endl;
|
||||
output << " ]" << endl;
|
||||
|
||||
if (exo_det_nbr() > 0)
|
||||
{
|
||||
output << "# Exogenous Deterministic Variables" << endl
|
||||
<< "model__.exo_det = [" << endl;
|
||||
<< "model.exo_det = [" << endl;
|
||||
if (exo_det_nbr() > 0)
|
||||
for (int id = 0; id < exo_det_nbr(); id++)
|
||||
output << " DynareModel.ExoDet(\""
|
||||
output << " DynareModel.ExoDet(\""
|
||||
<< getName(exo_det_ids[id]) << "\", \""
|
||||
<< getTeXName(exo_det_ids[id]) << "\", \""
|
||||
<< getLongName(exo_det_ids[id]) << "\")" << endl;
|
||||
output << " ]" << endl;
|
||||
output << " ]" << endl;
|
||||
}
|
||||
|
||||
output << "# Parameters" << endl
|
||||
<< "model__.param = [" << endl;
|
||||
<< "model.param = [" << endl;
|
||||
if (param_nbr() > 0)
|
||||
for (int id = 0; id < param_nbr(); id++)
|
||||
output << " DynareModel.Param(\""
|
||||
|
@ -768,12 +768,12 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
|||
<< getLongName(param_ids[id]) << "\")" << endl;
|
||||
output << " ]" << endl;
|
||||
|
||||
output << "model__.orig_endo_nbr = " << orig_endo_nbr() << endl;
|
||||
output << "model.orig_endo_nbr = " << orig_endo_nbr() << endl;
|
||||
|
||||
if (aux_vars.size() > 0)
|
||||
for (int i = 0; i < (int) aux_vars.size(); i++)
|
||||
{
|
||||
output << "push!(model__.aux_vars, "
|
||||
output << "push!(model.aux_vars, "
|
||||
<< getTypeSpecificID(aux_vars[i].get_symb_id()) + 1 << ", "
|
||||
<< aux_vars[i].get_type() << ", ";
|
||||
switch (aux_vars[i].get_type())
|
||||
|
@ -804,7 +804,7 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
|||
|
||||
if (predeterminedNbr() > 0)
|
||||
{
|
||||
output << "model__.pred_vars = [ ";
|
||||
output << "model.pred_vars = [ ";
|
||||
for (set<int>::const_iterator it = predetermined_variables.begin();
|
||||
it != predetermined_variables.end(); it++)
|
||||
output << getTypeSpecificID(*it)+1 << "; ";
|
||||
|
|
Loading…
Reference in New Issue