aiplan4eu / unified-planning

The AIPlan4EU Unified Planning Library
Apache License 2.0
192 stars 41 forks source link

fix: proto explicit init #562

Closed arbimo closed 9 months ago

arbimo commented 9 months ago

Until now, all initial values (including implicit ones) written in the initial state when converting to protobuf. This is problematic as it means the problem reconstructed after export and importing to protobuf was not strictly equivalent: some implicit values were made explicit in process.

A bad consequence is that it made protobuf conversions much more expensive that it had too (even after the optimization of #559, 90% of the time spend remains in the initial state generation in at least some non trivial problems).

This PR only save to protobuf the explicitly set initial values. The defaults values of the fluent were already there.

codecov-commenter commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (b56baea) 85.12% compared to head (51950ae) 85.13%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #562 +/- ## ======================================= Coverage 85.12% 85.13% ======================================= Files 201 201 Lines 26965 26982 +17 ======================================= + Hits 22954 22971 +17 Misses 4011 4011 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

arbimo commented 9 months ago

Thanks for the review! I'll merge it as it is then.

the problem reconstructed is not exactly the same since it doesn't contain the "general" defaults. But I don't think it is a problem. You can proceed with the merge.

You are right, but this will be reflected on the fluent's default (even though the problem will not be exactly similar if you were to add new fluents). I think I added this step of promoting a global default to a fluent default precisely because I was not very at ease with adding global default in the protobuf encoding ^^