Added goal-utilities requirement with a warning if used for compatibility.

This commit is contained in:
Patrick Lühne 2016-06-09 15:52:57 +02:00
parent 26d7e216a6
commit bbb6379907
2 changed files with 11 additions and 3 deletions

View File

@ -46,7 +46,8 @@ class Requirement
TimedInitialLiterals,
Preferences,
Constraints,
ActionCosts
ActionCosts,
GoalUtilities
};
static Requirement parse(Context &context);

View File

@ -44,7 +44,8 @@ const RequirementTypeNames requirementTypesToPDDL = boost::assign::list_of<Requi
(Requirement::Type::TimedInitialLiterals, "timed-initial-literals")
(Requirement::Type::Preferences, "preferences")
(Requirement::Type::Constraints, "constraints")
(Requirement::Type::ActionCosts, "action-costs");
(Requirement::Type::ActionCosts, "action-costs")
(Requirement::Type::GoalUtilities, "goal-utilities");
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -69,7 +70,8 @@ const RequirementTypeNames requirementTypesToASP = boost::assign::list_of<Requir
(Requirement::Type::TimedInitialLiterals, "timedInitialLiterals")
(Requirement::Type::Preferences, "preferences")
(Requirement::Type::Constraints, "constraints")
(Requirement::Type::ActionCosts, "actionCosts");
(Requirement::Type::ActionCosts, "actionCosts")
(Requirement::Type::GoalUtilities, "goalUtilities");
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -89,6 +91,11 @@ Requirement Requirement::parse(Context &context)
if (match == requirementTypesToPDDL.right.end())
throw utils::ParserException(context.parser, "Unknown PDDL requirement \"" + requirementName + "\"");
const auto requirementType = match->second;
if (requirementType == Requirement::Type::GoalUtilities)
context.logger.parserWarning(context.parser, "Requirement \"goal-utilities\" is not part of the PDDL 3.1 specification");
return Requirement(match->second);
}