Turned exception about unspecified requirements into a warning, now also for problems.
This commit is contained in:
parent
ca30f8a815
commit
31d0a1fb38
@ -33,7 +33,7 @@ class Problem
|
|||||||
|
|
||||||
const Requirements &requirements() const;
|
const Requirements &requirements() const;
|
||||||
bool hasRequirement(Requirement::Type requirementType) const;
|
bool hasRequirement(Requirement::Type requirementType) const;
|
||||||
void checkRequirement(Requirement::Type requirementType) const;
|
void checkRequirement(Requirement::Type requirementType);
|
||||||
|
|
||||||
expressions::Constants &objects();
|
expressions::Constants &objects();
|
||||||
const expressions::Constants &objects() const;
|
const expressions::Constants &objects() const;
|
||||||
|
@ -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))
|
if (hasRequirement(requirementType))
|
||||||
return;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Reference in New Issue
Block a user