Hello again!
I have a question about bach.constraints. I am trying to achieve more efficiency in the computation of solutions using the deterministic solver. Is there any advantage to ordering rules in a certain way when listing them in the [bach.keys] object that gets placed under the rightmost outlet of [bach.constraints]?
Here is a more specific instance of what I am asking. Let's say I want to check the entire proposed solution for some property (such as "has a unique high or low point") and reject it if it violates that constraint. But I also want to check every pairwise proposed solution for a property (such as "does not repeat a note twice"). Would it make any difference to the engine to order these constraints in a particular way in [bach.keys]?
E.g. [bach.keys hilopoint repeatnote] versus [bach.keys repeatnote hilopoint].
Many thanks & best wishes -- paul
Efficiency in bach.constraints
-
- Posts: 209
- Joined: Fri Dec 03, 2010 1:51 pm
Re: Efficiency in bach.constraints
Hi,
There might be a minimal performance improvement if rules that are evaluated more times appear earlier in bach.keys, but I wouldn't expect anything significant.
On the other hand, the deterministic engine of bach.constraints internally rearranges both the constraints and the domains so as to improve the efficiency of the search.
Best,
andrea
There might be a minimal performance improvement if rules that are evaluated more times appear earlier in bach.keys, but I wouldn't expect anything significant.
On the other hand, the deterministic engine of bach.constraints internally rearranges both the constraints and the domains so as to improve the efficiency of the search.
Best,
andrea
-
- Posts: 22
- Joined: Sun Jul 11, 2021 7:35 am
Re: Efficiency in bach.constraints
Thank you, Andrea! Needless to say I am utterly fascinated with the harmony generator in the help file of [bach.constraints] -- it has provided much inspiration over the last few months. Slowly but surely I am learning more about how it all works. Best always -- paul
Re: Efficiency in bach.constraints
I would like to join in my praise to bach.constraints. I'm using it a lot, but I still have a lot to learn!