Hiding translated PDDL sections if empty.

This commit is contained in:
Patrick Lühne 2016-06-12 22:19:24 +02:00
parent 979d9509c1
commit 89bb54a3ec

View File

@ -40,6 +40,8 @@ void TranslatorASP::translateDomain(std::ostream &ostream) const
const auto &domain = m_description.domain();
// Types
if (!domain.types().empty())
{
ostream << std::endl;
ostream << "% types";
@ -60,8 +62,11 @@ void TranslatorASP::translateDomain(std::ostream &ostream) const
ostream << "inherits(type(" << type->name() << "), type(" << parentType->name() << "))." << std::endl;
});
});
}
// Constants
if (!domain.constants().empty())
{
ostream << std::endl;
ostream << "% constants";
@ -82,6 +87,7 @@ void TranslatorASP::translateDomain(std::ostream &ostream) const
ostream << "hasType(constant(" << constant->name() << "), type(" << type->name() << "))." << std::endl;
});
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////