code: public boolean needToCompare(S solution1, S solution2) {
      boolean needToCompare;
      double overall1, overall2;
      overall1 = Math.abs(numberOfViolatedConstraints.getAttribute(solution1) *
          overallConstraintViolation.getAttribute(solution1));
      overall2 = Math.abs(numberOfViolatedConstraints.getAttribute(solution2) *
          overallConstraintViolation.getAttribute(solution2));
  
      needToCompare = (overall1 > this.threshold) || (overall2 > this.threshold);
  
      return needToCompare;
    }
docs: Returns true if solutions s1 and/or s2 have an overall constraint
  violation with value less than 0