From f72fcbbe781267024ca12ab0f462ef20cd15f044 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Thu, 3 Sep 2015 17:04:34 +0200
Subject: [PATCH] preprocessor: make ramsey_policy/ramsey_model and
 discretionary_policy mutually exclusive. closes #1047

---
 preprocessor/ModFile.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index f14c7b479f..6b376764f6 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -141,6 +141,13 @@ ModFile::checkPass()
       exit(EXIT_FAILURE);
     }
 
+  if ((mod_file_struct.ramsey_model_present || mod_file_struct.ramsey_policy_present)
+      && mod_file_struct.discretionary_policy_present)
+    {
+      cerr << "ERROR: You cannot use the discretionary_policy command when you use either rasmey_model or ramsey_policy and vice versa" << endl;
+      exit(EXIT_FAILURE);
+    }
+
   if (((mod_file_struct.ramsey_model_present || mod_file_struct.discretionary_policy_present) 
        && !mod_file_struct.planner_objective_present)
       || (!(mod_file_struct.ramsey_model_present || mod_file_struct.discretionary_policy_present)
-- 
GitLab