Beispiel #1
0
 // ***********************************************************************************
 // PROPAGATION
 // ***********************************************************************************
 @Override
 public void propagate(int evtmask) throws ContradictionException {
   toCheck.clear();
   for (int v = 0; v < n; v++) {
     if (vars[v].instantiated()) {
       toCheck.push(v);
     }
   }
   fixpoint();
 }
Beispiel #2
0
 private void fixpoint() throws ContradictionException {
   try {
     while (toCheck.size() > 0) {
       int vidx = toCheck.pop();
       int val = vars[vidx].getValue();
       for (int i = 0; i < n; i++) {
         if (i != vidx) {
           if (vars[i].removeValue(val, aCause)) {
             if (vars[i].instantiated()) {
               toCheck.push(i);
             }
           }
         }
       }
     }
   } catch (ContradictionException cex) {
     toCheck.clear();
     throw cex;
   }
 }
Beispiel #3
0
 @Override
 public void propagate(int varIdx, int mask) throws ContradictionException {
   toCheck.push(varIdx);
   fixpoint();
 }