Sébastien Mouthuy wrote:

class SVconstrainer {

        //eventually some IntVar and SetVar
        SetVar S1, S2;

        IntVar Tmp;

        constrain( Space *home, SetVar S, IntVar C){

                // post of some propagators
                cardinality(home, S , 1 , 3);
                rel(home, S1, SRT_NEQ, S);

                weight(home, .., .., S, C);

                ...
        }

        SVConstrainer (Space *home, bool share, SVconstrainer& svc){
                S1.update(home, share, svc.S1);
                S2.update(home, share, svc.S2;
                Tmp.update(home, sharfe, svc.Tmp);
        }
};

Where are S1, S2 and Tmp initialized?

I tried to reconstruct your first example (it's attached), and it works allright here. The cardinality of the set variable is constrained by callling a static function defined in another class. Please have a look and let us know if this is what you were planning to do.

Cheers,
        Guido

Attachment: mouthuy.cc
Description: Binary data



_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to