aig-upf / tarski

Tarski - An AI Planning Modeling Framework
Apache License 2.0
59 stars 19 forks source link

FstripsReader - plan_metric property of problem object returns None #84

Closed anubhav-cs closed 4 years ago

anubhav-cs commented 4 years ago

Hi @gfrances @miquelramirez ,

Observed that problem.plan_metric property returns None for the domains which do have :metric defined in the pddl, for example - IPC-2018->flashfill and organic-synthesis-split.

Attempted to use fstripsParser's optimization and metricSpec rules, but couldn't get them to populate the metric expression and type .

This info is required to setup action cost appropriately. Is it possible to populate and retrieve this information using FstripsReader or FstripsParser classes?

miquelramirez commented 4 years ago

Hi @anubhav-cs ,

this commit should solve the issue: see if the all the tests for tests_fstrips_parsing are executing correctly. The problem was a typo in FStripsReader.visitProblemMetric, that's the event handler that the parser calls whenever it comes across a (:metric ...) construct. We were storing the metric on a metric attribute, when it should be the metric_ attribute. I changed that anyways to a property setter, that should be clearer -- as there is a metric method on the interface of the Problem class.

gfrances commented 4 years ago

Looks like this is solved, I'll close the issue!