[gecode-users] Views and serialization
Gustavo Gutierrez
ggutierrez at cic.puj.edu.co
Sat Nov 24 06:40:09 CET 2007
On Nov 23, 2007 5:04 PM, Guido Tack <tack at ps.uni-sb.de> 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
More information about the gecode-users
mailing list