On Nov 23, 2007 5:04 PM, Guido Tack <[EMAIL PROTECTED]> wrote:

> It's nearly right.  You need a fresh VarMap for the Deserializer.  The
> idea is that the correspondence between variables in source and target
> is purely by name.  So the code could look like this:
>
> void merge(Queens *target, Queens *source) {
>    VarMap *vmp = target->exportVars();
>    Reflection::SpecIter si = source->actorSpecs(*vmp);
>
>    VarMap vm_target;
>    Gecode::Serialization::Deserializer ds(target, vm_target);
>
>    while (si()) {
>      ds.post(si.actor());
>      ++si;
>    }
> }
>

I am getting some memory errors after the suggested modification. I
get a "bus error" which is, IMO, the equivalent to segmentation fault
in linux. It seems that the fresh VarMap, vm_target, is causing the
problem. After looking at test/int.cc i see that before using the
fresh VarMap the array of variables is registered. Then i have the
following question: What is registerArray intended for?, and what is
the difference with putArray?. I try to call this method before actor
iteration but the error is still there.

Cheers,
-- 
Gustavo Gutierrez

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

Reply via email to