[gecode-users] Advisor on a ViewArray and index of assigned variable

Valentin Lemière valentin.lemiere at unicaen.fr
Mon Nov 9 16:56:16 CET 2015


Hello everyone, 

I am a PhD. student and I am currently looking at Gecode to see if it'll fit my needs. 

I need to implement a global constraint on a large number of boolean variables. So I have extended from NaryPropagator with a view of type BoolView. 
When a variable is assigned, the propagator infers some knowledge and may assign other variable(s). 

To get the required information, I added an Advisor to each variable, storing its index; so I can get it in the advise method and provide it to the propagator. 
But this technique is too slow and creates too much advisors. 

So I tried adding an Advisor directly to the ViewArray; the advise function is correctly called and I can still get whether the variable was assigned a zero or a one with the delta. 
But I don't get the index information to find the actual assigned variable. 
I looked for a static method of ViewArray to convert the delta to this information but couldn't find one. 

Can an Advisor on a ViewArray get the index of the assigned variable? 
Or is there another way to deal with a large number of variables other than an Advisor per variable? 

Regards, 
Valentin 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20151109/3fdcee39/attachment.html>


More information about the users mailing list