@Test public void testSimpleConflictDetection_5() throws FileNotFoundException, DiagnosisException { java.util.Set<Constraint> minCS = null; java.util.Set<Constraint> constraintsSetC = new LinkedHashSet<Constraint>(); java.util.Set<Element> decisionsVar = new LinkedHashSet<Element>(); String fileName = UtilsForTest.getTestDataset1(constraintsSetC, decisionsVar); AbstractConflictDetection conflictDetection = new SimpleConflictDetection(fileName); minCS = conflictDetection.getMinConflictSet(constraintsSetC); assertNotNull(minCS); }
@Override public Set<Constraint> getMinConflictSet(Set<Constraint> constraintsSetC) throws DiagnosisException { Set<Constraint> cs = new LinkedHashSet<Constraint>(); if (consistencyChecker.isConsistent(constraintsSetC, fixedModel)) { return null; } Set<Constraint> intermediaryCS = new LinkedHashSet<Constraint>(); boolean isInconsistent; do { intermediaryCS.clear(); intermediaryCS.addAll(cs); Constraint c = null; do { c = getElement(constraintsSetC, intermediaryCS); if (c == null) { return Collections.emptySet(); } intermediaryCS.add(c); isInconsistent = !consistencyChecker.isConsistent(intermediaryCS, fixedModel); } while (!isInconsistent); appendSet(cs, c); isInconsistent = !consistencyChecker.isConsistent(cs, fixedModel); } while (!isInconsistent); Collections.reverse(new ArrayList<>(cs)); return cs; }
SimpleConflictDetection extends AbstractConflictDetection { @Override public Set<Constraint> getMinConflictSet(Set<Constraint> constraintsSetC) throws DiagnosisException { Set<Constraint> cs = new LinkedHashSet<Constraint>(); if (consistencyChecker.isConsistent(constraintsSetC, fixedModel)) { return null; } Set<Constraint> intermediaryCS = new LinkedHashSet<Constraint>(); boolean isInconsistent; do { intermediaryCS.clear(); intermediaryCS.addAll(cs); Constraint c = null; do { c = getElement(constraintsSetC, intermediaryCS); if (c == null) { return Collections.emptySet(); } intermediaryCS.add(c); isInconsistent = !consistencyChecker.isConsistent(intermediaryCS, fixedModel); } while (!isInconsistent); appendSet(cs, c); isInconsistent = !consistencyChecker.isConsistent(cs, fixedModel); } while (!isInconsistent); Collections.reverse(new ArrayList<>(cs)); return cs; } }
SimpleConflictDetection extends AbstractConflictDetection { @Override public Set<Constraint> getMinConflictSet(Set<Constraint> constraintsSetC) throws DiagnosisException { Set<Constraint> cs = new LinkedHashSet<Constraint>(); if (consistencyChecker.isConsistent(constraintsSetC, fixedModel)) { return null; } Set<Constraint> intermediaryCS = new LinkedHashSet<Constraint>(); boolean isInconsistent; do { intermediaryCS.clear(); intermediaryCS.addAll(cs); Constraint c = null; do { c = getElement(constraintsSetC, intermediaryCS); if (c == null) { return Collections.emptySet(); } intermediaryCS.add(c); isInconsistent = !consistencyChecker.isConsistent(intermediaryCS, fixedModel); } while (!isInconsistent); appendSet(cs, c); isInconsistent = !consistencyChecker.isConsistent(cs, fixedModel); } while (!isInconsistent); Collections.reverse(new ArrayList<>(cs)); return cs; } SimpleConflictDetection(String mznFullFileName);  SimpleConflictDetection(String mznFullFileName, Collection<? extends Element> fixedModel); }
SimpleConflictDetection extends AbstractConflictDetection { @Override public Set<Constraint> getMinConflictSet(Set<Constraint> constraintsSetC) throws DiagnosisException { Set<Constraint> cs = new LinkedHashSet<Constraint>(); if (consistencyChecker.isConsistent(constraintsSetC, fixedModel)) { return null; } Set<Constraint> intermediaryCS = new LinkedHashSet<Constraint>(); boolean isInconsistent; do { intermediaryCS.clear(); intermediaryCS.addAll(cs); Constraint c = null; do { c = getElement(constraintsSetC, intermediaryCS); if (c == null) { return Collections.emptySet(); } intermediaryCS.add(c); isInconsistent = !consistencyChecker.isConsistent(intermediaryCS, fixedModel); } while (!isInconsistent); appendSet(cs, c); isInconsistent = !consistencyChecker.isConsistent(cs, fixedModel); } while (!isInconsistent); Collections.reverse(new ArrayList<>(cs)); return cs; } SimpleConflictDetection(String mznFullFileName);  SimpleConflictDetection(String mznFullFileName, Collection<? extends Element> fixedModel); @Override Set<Constraint> getMinConflictSet(Set<Constraint> constraintsSetC); }
SimpleConflictDetection extends AbstractConflictDetection { @Override public Set<Constraint> getMinConflictSet(Set<Constraint> constraintsSetC) throws DiagnosisException { Set<Constraint> cs = new LinkedHashSet<Constraint>(); if (consistencyChecker.isConsistent(constraintsSetC, fixedModel)) { return null; } Set<Constraint> intermediaryCS = new LinkedHashSet<Constraint>(); boolean isInconsistent; do { intermediaryCS.clear(); intermediaryCS.addAll(cs); Constraint c = null; do { c = getElement(constraintsSetC, intermediaryCS); if (c == null) { return Collections.emptySet(); } intermediaryCS.add(c); isInconsistent = !consistencyChecker.isConsistent(intermediaryCS, fixedModel); } while (!isInconsistent); appendSet(cs, c); isInconsistent = !consistencyChecker.isConsistent(cs, fixedModel); } while (!isInconsistent); Collections.reverse(new ArrayList<>(cs)); return cs; } SimpleConflictDetection(String mznFullFileName);  SimpleConflictDetection(String mznFullFileName, Collection<? extends Element> fixedModel); @Override Set<Constraint> getMinConflictSet(Set<Constraint> constraintsSetC);  }