On Nov 23, 2007 5:04 PM, Guido Tack <[EMAIL PROTECTED]> wrote:
> After iterating all the actors, vmp will contain all variables in
> source, and you can iterate them using a VarMapIter.  For each
> variable, you get a VarSpec that tells you what type the variable
> has.  Furthermore, you can use the spec you get to recreate the
> variable in target:

Does this mean that creating a VarMap is not only achieved by putting
the VarArray but also by iterating all the actors?.
I mean, for the queens problem for instance, the following two codes
do the same in which respects to filling a VarMap?

code 1:

  VarMap * exportVars(void) {
    VarMap *vmp = new VarMap();
    Support::Symbol symb("root",true);
    vmp->putArray(this,q,symb);
    return vmp;
  }


code 2:

VarMap * exportVars2(void) {
    VarMap *vmp = new VarMap();
    SpecIter si = actorSpecs(*vmp);
   while (si())
    ++si;
   return vmp;
  }

If that is true i find the second a more general approach, since it
automatically collects only variables related to constraints.

Cheers,
-- 
Gustavo Gutierrez

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

Reply via email to