From 75ba2c4e9f1b0d578754973914ae61e5b533db52 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Thu, 15 Feb 2018 15:54:10 +0100 Subject: [PATCH] pac_expectation: clarify output for growth --- ExprNode.cc | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/ExprNode.cc b/ExprNode.cc index 0501d18a..54bc4189 100644 --- a/ExprNode.cc +++ b/ExprNode.cc @@ -7397,10 +7397,26 @@ PacExpectationNode::writeOutput(ostream &output, ExprNodeOutputType output_type, << "M_.pac_expectation." << model_name << ".equation_number = " << equation_number + 1 << ";" << endl; if (growth_symb_id >= 0) - output << "M_.pac_expectation." << model_name << ".growth_name = '" - << datatree.symbol_table.getName(growth_symb_id) << "';" << endl - << "M_.pac_expectation." << model_name << ".growth_neutrality_param_index = " - << datatree.symbol_table.getTypeSpecificID(growth_param_index) + 1 << ";" << endl; + output << "M_.pac_expectation." << model_name << ".growth_neutrality_param_index = " + << datatree.symbol_table.getTypeSpecificID(growth_param_index) + 1 << ";" << endl + << "M_.pac_expectation." << model_name << ".growth_index = " + << datatree.symbol_table.getTypeSpecificID(growth_symb_id) + 1 << ";" << endl + << "M_.pac_expectation." << model_name << ".growth_type = "; + switch(datatree.symbol_table.getType(growth_symb_id)) + { + case eEndogenous: + output << "'endogenous';" << endl; + break; + case eExogenous: + output << "'exogenous';" << endl; + break; + case eParameter: + output << "'exogenous';" << endl; + break; + default: + cerr << "pac_expectation: error encountered in growth type" << endl; + exit(EXIT_FAILURE); + } output << "M_.pac_expectation." << model_name << ".equation_params = ["; for (set > >::const_iterator it = params_and_vals.begin();