Function plansys2::replace_children_param

Function Documentation

plansys2_msgs::msg::Tree plansys2::replace_children_param(const plansys2_msgs::msg::Tree &tree, const uint8_t &node_id, const std::map<std::string, std::string> &replace)

Replace parameter names in children nodes of a PDDL expression tree. This function creates a new tree and recursively replaces parameter names in the current node and all its children according to the replacement map. It’s commonly used in quantified expressions (exists, forall) to substitute parameters with specific values.

Parameters:
  • tree[in] The PDDL expression tree.

  • node_id[in] The identifier of the node to start replacement.

  • replace[in] Map of original parameter names to replacement names.

Returns:

plansys2_msgs::msg::Tree The modified tree with replaced parameter names.