Added translation of effects of PDDL actions.

This commit is contained in:
Patrick Lühne 2016-06-13 02:41:23 +02:00
parent e2b8fd2880
commit e018cdbc91

View File

@ -333,6 +333,29 @@ void TranslatorASP::translateActions() const
}
}
// Effect
if (action->effect())
{
const auto &effect = *action->effect();
if (effect.expressionType() == Expression::Type::Predicate
|| effect.expressionType() == Expression::Type::Not)
{
translateLiteral("postcondition", effect);
}
// Assuming a conjunction
else
{
const auto &andExpression = dynamic_cast<const expressions::And &>(effect);
std::for_each(andExpression.arguments().cbegin(), andExpression.arguments().cend(),
[&](const auto *argument)
{
translateLiteral("postcondition", *argument);
});
}
}
m_ostream << std::endl;
});
}