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
Previously I used the CardEnc class to encode size constraints. I need multiple constraints and so I used a single IDPool and passed it along all of the CardEnc instances. Then I wanted to make the size constraints incremental, and switched to ITotalizer. But this class does not take an IDPool, only a top_id.
Currently, my workaround is as follows:
vpool = IDPool()
...
with ITotalizer(lits, ubound=upper_bound, top_id=vpool.top) as cnf_optim:
vpool.occupy(vpool.top + 1, cnf_optim.top_id)
vpool.top = cnf_optim.top_id
...
Is this a correct workaround?
And would it be possible to add a vpool variable to the ITotalizer class, just like the CardEnc class? I find it much easier (and less error-prone) to use than passing around a top variable.
Thanks for the pysat package! It is really a wonderful interface to work with!
The text was updated successfully, but these errors were encountered:
Yes, at first glance this workaround looks okay although it might be simpler to give the range from 1 to cnf_optim.top_id when declaring it as occupied. (The method should take care of the fact that the new range is a superset of the previous.)
As for adding a vpool argument to ITotalizer, this would make perfect sense to me. So I will definitely do it at some point when and if I get a chance. Thanks for the suggestion!
Hi all,
Previously I used the
CardEnc
class to encode size constraints. I need multiple constraints and so I used a singleIDPool
and passed it along all of theCardEnc
instances. Then I wanted to make the size constraints incremental, and switched toITotalizer
. But this class does not take anIDPool
, only atop_id
.Currently, my workaround is as follows:
Is this a correct workaround?
And would it be possible to add a
vpool
variable to theITotalizer
class, just like theCardEnc
class? I find it much easier (and less error-prone) to use than passing around a top variable.Thanks for the pysat package! It is really a wonderful interface to work with!
The text was updated successfully, but these errors were encountered: