AI-Planning / planning-as-a-service

The newly improved planner (and more) in the cloud.
Apache License 2.0
30 stars 8 forks source link

[55] Fix planning editor adaptor #56

Closed chillray closed 5 months ago

chillray commented 5 months ago

Description: The issue stems from the way parameters are parsed in the planning_editor_adaptor when one parameter is a substring of another. For instance, in the Floortile domain (see issue #55), the parameter '?c' was incorrectly parsed as '?c2' due to partial matches.

Root cause: This misinterpretation is traced back to the code in predicate.py, lines 118-119: https://github.com/AI-Planning/planning-as-a-service/blob/3ef6c88d9d9b8f1cab1f092f1a2993ef06ecd1d1/server/api/adaptor/planning_editor_adaptor/action_plan_parser/predicate.py#L118-L119

Solution A regex-based solution has been implemented, which ensures exact matching of keys. The keys are ordered by length in descending order to prevent partial matches and ensure accurate replacement of parameters in actions.

Resolves #55

haz commented 5 months ago

Looks good, thanks!