Пример #1
0
 private void findCovered() {
   for (int i = 0; i < solution.size(); i++)
     for (int j = i + 1; j < solution.size(); j++) {
       Pair2 p = new Pair2(idnr);
       int p0 = solution.get(i);
       int p1 = solution.get(j);
       for (BooleanVariableInterface var : vars) {
         if (var.getID().equals(nrid.get(Math.abs(p0)))) {
           p.v1 = var;
           p.b1 = p0 > 0;
         }
       }
       for (BooleanVariableInterface var : vars) {
         if (var.getID().equals(nrid.get(Math.abs(p1)))) {
           p.v2 = var;
           p.b2 = p1 > 0;
         }
       }
       covered.add(p);
     }
 }
Пример #2
0
 @Override
 public String toString() {
   return v.getID() + ":" + b;
 }