[gecode-users] Debugging branching

Mikael Zayenz Lagerkvist zayenz at kth.se
Wed Jan 21 07:36:08 CET 2009


Hi,

While I'm not sure about the exact reason for your failure (especially
without seeing your code), it could be that you call the wrong
Branching-constructor in your copy constructor. See the example custom
branchings in examples/black-hole.cc and examples/queen-armies.cc for
guidance.

Cheers,
Mikael

On Wed, Jan 21, 2009 at 7:21 AM, Malcolm Ryan <malcolmr at cse.unsw.edu.au> wrote:
> I've written a custom branching and I am trying to write some unit
> tests to make sure it is working properly. As such, I am doing the
> branching and propagation process step-by-step, but there is something
> wrong with my code. I have:
>
>        ConcretePlanSpace *space = new ConcretePlanSpace(graph, 1, 10);
>        ConcretePlanBranching *branching = new (space)
> ConcretePlanBranching(space);
>
>        assert(space->status() == SS_BRANCH);
>
>        const BranchingDesc* desc = space->description();
>        space->commit(desc, 0);
>
>        assert(space->status() == SS_BRANCH);
>
> That much of the code works fine, but I want to create a clone of the
> space to test out different alternatives:
>
>        Space* copy = space->clone(false);
>        desc = copy->description();
>        copy->commit(desc, 0);
>
> When it gets to commit() the code fails. GDB shows:
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x0000000b
> 0x001d1e0b in Gecode::Space::commit (this=0xf17460, d=0x7, a=0) at
> gecode/kernel/core.cc:330
> 330         while ((b_commit != Branching::cast(&a_actors)) &&
>
> Any ideas what I am doing wrong?
>
> Thanks,
>
> Malcolm
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>



-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list