Feature request: bach.comb @maxcount

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
pedrnun
Posts: 74
Joined: Sun Jan 17, 2016 3:23 am
Contact:

Feature request: bach.comb @maxcount

Post by pedrnun » Sat Feb 10, 2018 8:35 pm

Dear Daniele and Andrea,

I was wondering: would it be feasible for you to implement an attribute to [bach.comb] similar to the @maxcount present in [bach.perm]? It would come in handy, since it would prevent long computation times while allowing big input lllls.

Do you know what would be great for both objects? A kind of '@iterout' attribute that would enable each combination/permutation to be outputas soon as it was computed (one by one).
I understand that it might be difficult to implement, since I've never seen such behaviour in other bach objects (it surely steers away from the llll concept) but, if it was possible, I find it would be very useful!

In my case, I have a pre-sorted (according to weights) input llll and I need to pass it through [bach.comb 4] and [bach.iter] and then through a rule set (a bunch of [if]s). As soon as a valid combination is found, iteration stops. Nevertheless, [bach.comb] must compute all combinations before iteration begins – a two-way process. In most cases (since the input llll is pre-sorted), a solution is found within the first few combinations, which means [bach.comb] is doing a lot of extra work. So, I figure an '@iterout' behaviour would cut computation times considerably.

Thanks!
Pedro Louzeiro

andreaagostini
Posts: 209
Joined: Fri Dec 03, 2010 1:51 pm

Re: Feature request: bach.comb @maxcount

Post by andreaagostini » Mon Feb 19, 2018 9:40 am

Hi Pedro,
I like the @iterout idea in principle, but I see serious complications along the way.
On the other hand, it should not be a problem adding a @maxcount attribute to bach.comb—request registered!
Cheers,
andrea

pedrnun
Posts: 74
Joined: Sun Jan 17, 2016 3:23 am
Contact:

Re: Feature request: bach.comb @maxcount

Post by pedrnun » Wed Feb 21, 2018 2:22 am

Great! Thanks!

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: Feature request: bach.comb @maxcount

Post by danieleghisi » Thu Jul 19, 2018 2:02 pm

Hi Pedro, it'll be in next release.
d

Post Reply