potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
599 stars 79 forks source link

Any way to retrieve the priority levels from an answer set? #440

Closed mbalduccini closed 1 year ago

mbalduccini commented 1 year ago

Pretty much as the title says... both the clingo executable and the API return the costs as a vector of integers, e.g.

Optimization: 1 2 1

Is it possible to retrieve the priority levels associated with those costs using the API?

This seems particularly important in multi-shot solving, where we have noticed that the size of the vector may actually decrease when new #minimize statements are added to program via the backend.

Thanks! Marcello

rkaminsk commented 1 year ago

406 extends the API to get this info. There is no release yet but the development packages on conda, etc. already provide the functionality.

mbalduccini commented 1 year ago

That's great, thanks! Does clingcon on conda also have it?

rkaminsk commented 1 year ago

That's great, thanks! Does clingcon on conda also have it?

clingcon is using clingo as a library. As long as you take the dev version of both, then it should be available.

mbalduccini commented 1 year ago

Great!