示例#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();
 }
示例#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;
   }
 }