You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Checks whether a PDDL action parameter contains types found in object types."""
43
+
44
+
types=typesor {}
45
+
46
+
# If no types are defined, inform the user and check for parameter types
47
+
ifnottypes:
48
+
forparam_name, param_typeinparameters.items():
49
+
ifparam_typeisnotNoneandparam_type!="":
50
+
feedback_msg= (
51
+
f'The parameter `{param_name}` has an object type `{param_type}` '
52
+
'while no types are defined. Please remove the object type from this parameter.'
53
+
)
54
+
returnFalse, feedback_msg
55
+
56
+
# if all parameter names do not contain a type
57
+
returnTrue, "PASS: All parameters are valid."
43
58
44
-
forparam_nameinparameters:
45
-
param_type=parameters[param_name]
59
+
# Otherwise, check that parameter types are valid in the given types
60
+
forparam_name, param_typeinparameters.items():
46
61
47
62
ifnotany(param_typeintfortintypes.keys()):
48
63
feedback_msg=f'There is an invalid object type `{param_type}` for the parameter {param_name} not found in the types {types.keys()}. If you need to use a new type, you can emulate it with an "is_{{type}} ?o - object" precondition. Please revise the PDDL model to fix this error.'
0 commit comments