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); } ////////////////////////////////////////////////////////////////////////////////////////////////////