[gecode-users] random / mod

Kilian Sprotte ml13 at onlinehome.de
Wed Aug 23 21:51:14 CEST 2006


Am 23.08.2006 um 10:34 schrieb Christian Schulte:
>
> PS: A word of caution: the propagation is very weak by the nature  
> of mod. A
> different approach for variables with a small domain and where b is  
> constant
> in a mod b is to use the element constraint: the array just  
> contains a mod b
> for different a's.

Hi,

thank you very much that helps me a lot! Especially the element  
approach will be very useful, since in music you deal very often with  
mod 12 ! :)

On my todo list is a propagator for a musical set-class modulo 12 --  
{0,1,3} will be a representative for itself as well as {1,2,4},  
{2,3,5} ... {11,0,2} - But analogous to what you have showed me, I  
suppose selectSet() might already be the solution, where the index is  
the transposition.... Cool!

Thanks again,

   Kilian

PS: I will surely recontact you next week, when I try to tackle the  
random branching... 
  




More information about the gecode-users mailing list