[gecode-users] FloatVar implementation

Filip Konvička filip.konvicka at logis.cz
Wed Apr 9 15:52:45 CEST 2008


> Hmm, I am not so sure that Guido is telling the truth here ;-) I just had a
> chat with him and he agrees ;-)
>   
I hope I didn't start any fight :-)
> The kernel only knows about a base class that contains no information
> whatsoever about how the domain of a variable is implemented.
>
> What is perfectly possible is to have variables of different types in the
> system that share the same baseclass: the kernel is only concerned with what
> is in the baseclass and not with how the variables are implemented. The key
> aspect is that variable implementations are only refered to by propagators
> and branchings: they statically know the real type so that the right
> operations are performed, so no need for virtual etc.
>
> Look to the generated baseclass IntVarImpBase and how IntVarImp inherits
> from it: IntVarImpBase is what the kernel deals with, while IntVarImp is the
> real implementation of integer variables.
>   
I've seen that, but what I need to understand is why you need distinct 
*VarImpBases for Int, Bool, etc., why not just one. The difference I've 
seen in kernel is that the classes report their own "event id" or 
whatever, so I guess you use this for speeding up actor filtering. 
Again, I'm just guessing and will need to look into this.

[...some time passes...]

OK, we've added float.vis and recompiled Gecode, so now it seems we have 
our own bunch of ModEvents and also a FloatVarImpBase, which is cool, so 
we'll come back with a status report (or more questions) soon :-)

> Having said all that, I would first attempt to get everything up for a
> single implementation. You can go crazy later ;-)
>   
I guess I'm crazy enough already - nothing ever stops me from making 
things more generic. Even if it takes 5 minutes to compile... :-))

Cheers,
Filip





More information about the gecode-users mailing list