code: public boolean valueEquals(GraphicalModel other, double tolerance) {
      if (!modelMetaData.equals(other.modelMetaData)) {
        return false;
      }
      if (!variableMetaData.equals(other.variableMetaData)) {
        return false;
      }
      // compare factor sets for equality
      Set<Factor> remaining = new HashSet<>();
      remaining.addAll(factors);
      for (Factor otherFactor : other.factors) {
        Factor match = null;
        for (Factor factor : remaining) {
          if (factor.valueEquals(otherFactor, tolerance)) {
            match = factor;
            break;
          }
        }
        if (match == null) return false;
        else remaining.remove(match);
      }
      return remaining.size() <= 0;
    }
docs: Check that two models are deeply value-equivalent, down to the concat vectors inside the factor tables, within
  some tolerance. Mostly useful for testing.
  
  @param other     the graphical model to compare against.
  @param tolerance the tolerance to accept when comparing concat vectors for value equality.
  @return whether the two models are tolerance equivalent