From 31d0a1fb38520f0ab103788329f5ca0c20257fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 18 Aug 2016 14:30:47 +0200 Subject: [PATCH] Turned exception about unspecified requirements into a warning, now also for problems. --- include/plasp/pddl/Problem.h | 2 +- src/plasp/pddl/Problem.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/plasp/pddl/Problem.h b/include/plasp/pddl/Problem.h index 5b6dc4f..c731853 100644 --- a/include/plasp/pddl/Problem.h +++ b/include/plasp/pddl/Problem.h @@ -33,7 +33,7 @@ class Problem const Requirements &requirements() const; bool hasRequirement(Requirement::Type requirementType) const; - void checkRequirement(Requirement::Type requirementType) const; + void checkRequirement(Requirement::Type requirementType); expressions::Constants &objects(); const expressions::Constants &objects() const; diff --git a/src/plasp/pddl/Problem.cpp b/src/plasp/pddl/Problem.cpp index 7aecb00..8a2799e 100644 --- a/src/plasp/pddl/Problem.cpp +++ b/src/plasp/pddl/Problem.cpp @@ -254,12 +254,14 @@ bool Problem::hasRequirement(Requirement::Type requirementType) const //////////////////////////////////////////////////////////////////////////////////////////////////// -void Problem::checkRequirement(Requirement::Type requirementType) const +void Problem::checkRequirement(Requirement::Type requirementType) { if (hasRequirement(requirementType)) return; - throw ConsistencyException("requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared"); + m_context.logger.logWarning(m_context.parser.coordinate(), "requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared"); + + m_requirements.push_back(requirementType); } ////////////////////////////////////////////////////////////////////////////////////////////////////