From 23e851ccef2f626db2f9bb6cd9ec0de887ab8e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Fri, 2 Sep 2016 18:49:30 +0200 Subject: [PATCH] =?UTF-8?q?Normalizing=20problems=E2=80=99=20goal=20descri?= =?UTF-8?q?ptions.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/plasp/pddl/Problem.h | 2 ++ src/plasp/pddl/Description.cpp | 3 +++ src/plasp/pddl/Problem.cpp | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/include/plasp/pddl/Problem.h b/include/plasp/pddl/Problem.h index c731853..d21b40f 100644 --- a/include/plasp/pddl/Problem.h +++ b/include/plasp/pddl/Problem.h @@ -45,6 +45,8 @@ class Problem void checkConsistency(); + void normalize(); + private: void parseRequirementSection(); void computeDerivedRequirements(); diff --git a/src/plasp/pddl/Description.cpp b/src/plasp/pddl/Description.cpp index 6d577ff..83672ae 100644 --- a/src/plasp/pddl/Description.cpp +++ b/src/plasp/pddl/Description.cpp @@ -207,6 +207,9 @@ void Description::checkConsistency() void Description::normalize() { m_domain->normalize(); + + if (m_problem) + m_problem->normalize(); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/plasp/pddl/Problem.cpp b/src/plasp/pddl/Problem.cpp index 8a2799e..9f38d69 100644 --- a/src/plasp/pddl/Problem.cpp +++ b/src/plasp/pddl/Problem.cpp @@ -395,5 +395,16 @@ void Problem::checkConsistency() //////////////////////////////////////////////////////////////////////////////////////////////////// +void Problem::normalize() +{ + BOOST_ASSERT(m_goal); + + // TODO: normalize objects and initial state + + m_goal->normalize(); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + } }