From 96c2e7aa86039c48d6b6e3009936e95cceea9aa5 Mon Sep 17 00:00:00 2001 From: Tom Silver Date: Tue, 17 Oct 2023 10:24:07 -0400 Subject: [PATCH] fix hierarchical typing edge case --- predicators/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/predicators/utils.py b/predicators/utils.py index b1ed1776cb..45b598680a 100644 --- a/predicators/utils.py +++ b/predicators/utils.py @@ -2806,9 +2806,10 @@ def create_pddl_domain(operators: Collection[NSRTOrSTRIPSOperator], for parent_type in sorted(parent_to_children_types): child_types = parent_to_children_types[parent_type] if not child_types: - continue - child_type_str = " ".join(t.name for t in child_types) - types_str += f"\n {child_type_str} - {parent_type.name}" + types_str += f"\n {parent_type.name}" + else: + child_type_str = " ".join(t.name for t in child_types) + types_str += f"\n {child_type_str} - {parent_type.name}" ops_lst = sorted(operators) preds_str = "\n ".join(pred.pddl_str() for pred in preds_lst) ops_strs = "\n\n ".join(op.pddl_str() for op in ops_lst)