PAC: better error message in case of name conflict for the growth neutrality correction parameter

pac-components
Sébastien Villemot 2021-10-06 16:33:31 +02:00
parent 9938cb2632
commit 78e295115a
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 11 additions and 3 deletions

View File

@ -4198,9 +4198,17 @@ DynamicModel::addPacModelConsistentExpectationEquation(const string &name, int d
void
DynamicModel::createPacGrowthNeutralityParameter(const string &pac_model_name)
{
int param_idx = symbol_table.addSymbol(pac_model_name +"_pac_growth_neutrality_correction",
SymbolType::parameter);
pac_growth_neutrality_params[pac_model_name] = param_idx;
string param_name = pac_model_name + "_pac_growth_neutrality_correction";
try
{
int param_idx = symbol_table.addSymbol(param_name, SymbolType::parameter);
pac_growth_neutrality_params[pac_model_name] = param_idx;
}
catch (SymbolTable::AlreadyDeclaredException)
{
cerr << "The parameter '" << param_name << "' conflicts with the auxiliary parameter that will be generated for the growth neutrality correction of the '" << pac_model_name << "' PAC model. Please rename that parameter." << endl;
exit(EXIT_FAILURE);
}
}
void