| 4558 | |
| 4559 | template<class VIC> |
| 4560 | forceinline bool |
| 4561 | VarImp<VIC>::advise(Space& home, ModEvent me, Delta& d) { |
| 4562 | /* |
| 4563 | * An advisor that is executed might remove itself due to subsumption. |
| 4564 | * As entries are removed from front to back, the advisors must |
| 4565 | * be iterated in forward direction. |
| 4566 | */ |
| 4567 | ActorLink** la = actorNonZero(pc_max+1); |
| 4568 | ActorLink** le = b.base+entries; |
| 4569 | if (la == le) |
| 4570 | return true; |
| 4571 | d.me = me; |
| 4572 | // An advisor that is run, might be removed during execution. |
| 4573 | // As removal is done from the back the advisors have to be executed |
| 4574 | // in inverse order. |
| 4575 | do { |
| 4576 | Advisor* a = Advisor::cast |
| 4577 | (static_cast<ActorLink*>(Support::funmark(*la))); |
| 4578 | assert(!a->disposed()); |
| 4579 | Propagator& p = a->propagator(); |
| 4580 | switch (p.advise(home,*a,d)) { |
| 4581 | case ES_FIX: |
| 4582 | break; |
| 4583 | case ES_FAILED: |
| 4584 | return false; |
| 4585 | case ES_NOFIX: |
| 4586 | schedule(home,p,me); |
| 4587 | break; |
| 4588 | case ES_NOFIX_FORCE: |
| 4589 | schedule(home,p,me,true); |
| 4590 | break; |
| 4591 | case ES_SUBSUMED_: |
| 4592 | default: |
| 4593 | GECODE_NEVER; |
| 4594 | } |
| 4595 | } while (++la < le); |
| 4596 | return true; |
| 4597 | } |
| 4598 | |
| 4599 | template<class VIC> |
| 4600 | void |
no test coverage detected