Skip to content

Commit

Permalink
in existPredicate check if derived predicate is satisfied
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezenders committed Aug 29, 2024
1 parent bf175c6 commit 3156cba
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,20 @@ ProblemExpert::existPredicate(const plansys2::Predicate & predicate)
i++;
}

if (!found)
{
std::vector<std::string> parameters_names;
std::for_each (predicate.parameters.begin(), predicate.parameters.end(),
[&](auto p){parameters_names.push_back(p.name);});
auto derived_predicates = domain_expert_->getDerivedPredicate(predicate.name, parameters_names);
for(auto derived : derived_predicates){
if(check(derived.preconditions, predicates_, functions_)){
found = true;
break;
}
}
}

return found;
}

Expand Down

0 comments on commit 3156cba

Please sign in to comment.