[gecode-users] assert in propagator cast

David Rijsman David.Rijsman at quintiq.com
Mon Oct 24 15:33:38 CEST 2011


I need some help with an assert being thrown by Gecode, hopefully by an error I made in a propagator I have created. Is there an obvious candidate for an error I made in my propagator when this assert is thrown?

The assert is thrown in core.hpp

  forceinline Propagator&
  Advisor::propagator(void) const {
    assert(!disposed());
    return *Propagator::cast(ActorLink::prev());
  }

as a result of an invocation of  Advisor::cast(*a)->propagator().afc() in:


  template<class VIC>
  forceinline double
  VarImp<VIC>::afc(void) const {
    if (degree() == 0)
      return 0.0;
    double d = degree();
    // Count the afc of each propagator
    {
      ActorLink** a = const_cast<VarImp<VIC>*>(this)->actor(0);
      ActorLink** e = const_cast<VarImp<VIC>*>(this)->actorNonZero(pc_max+1);
      while (a < e) {
        d += Propagator::cast(*a)->afc(); a++;
      }
    }
    // Count the afc of each advisor's propagator
    {
      ActorLink** a = const_cast<VarImp<VIC>*>(this)->actorNonZero(pc_max+1);
      ActorLink** e = const_cast<VarImp<VIC>*>(this)->base+entries;
      while (a < e) {
        d += Advisor::cast(*a)->propagator().afc(); a++;
      }
    }
    return d;
  }

thanks,

David Rijsman




More information about the users mailing list