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
Now that I am moving my code from using old ROSPlan version to the latest one, I have realized about this issue.
The "makeInitialState()" method of "PDDLProblemGenerator" writes parameters of a predicate following the order in which they are stored in KB, but this is wrong. And same problem is happening in "makeGoals()". The parameters of a predicate could be stored in any order in the KB because they have name, but the problem file generated is wrong due to this assumption.
While in the old version there is the code after "// find the PDDL parameters in the KnowledgeItem". And in my understanding it is this code which guarantees to write the parameters of the predicates in the correct order.
// add knowledge to the initial state
for(size_t i=0; i<environment.instance_attributes.size(); i++) {
std::stringstream ss;
bool writeAttribute = false;
// check if attribute is a PDDL predicate
std::map<std::string,std::vector<std::string> >::iterator ait;
ait = environment.domain_predicates.find(environment.instance_attributes[i].attribute_name);
if(ait != environment.domain_predicates.end()) {
writeAttribute = true;
ss << " (" + environment.instance_attributes[i].attribute_name;
// find the PDDL parameters in the KnowledgeItemAs conclusion, in
for(size_t j=0; j<ait->second.size(); j++) {
bool found = false;
for(size_t k=0; k<environment.instance_attributes[i].values.size(); k++) {
if(0 == environment.instance_attributes[i].values[k].key.compare(ait->second[j])) {
ss << " " << environment.instance_attributes[i].values[k].value;
found = true;
}
}
if(!found) writeAttribute = false;
};
ss << ")";
}
if(writeAttribute) pFile << ss.str() << std::endl;
}
Same code could be found in "makeGoals()" of old version of ROSPlan.
Therefore, my conclusion is that this is a bug. Please, could someone confirm it? Thanks.
The text was updated successfully, but these errors were encountered:
Now that I am moving my code from using old ROSPlan version to the latest one, I have realized about this issue.
The "makeInitialState()" method of "PDDLProblemGenerator" writes parameters of a predicate following the order in which they are stored in KB, but this is wrong. And same problem is happening in "makeGoals()". The parameters of a predicate could be stored in any order in the KB because they have name, but the problem file generated is wrong due to this assumption.
My domain:
The correct generated problem file should be:
Generated problem file:
As this is is not happening in the old version of ROSPlan, I have compared both codes. The makeInitialState() in the new version of ROSPlan is:
While in the old version there is the code after "// find the PDDL parameters in the KnowledgeItem". And in my understanding it is this code which guarantees to write the parameters of the predicates in the correct order.
Same code could be found in "makeGoals()" of old version of ROSPlan.
Therefore, my conclusion is that this is a bug. Please, could someone confirm it? Thanks.
The text was updated successfully, but these errors were encountered: