code: @Override
      public double defuzzify(Term term, double minimum, double maximum) {
          Aggregated fuzzyOutput = (Aggregated) term;
          if (fuzzyOutput.getTerms().isEmpty()) {
              return Double.NaN;
          }
          minimum = fuzzyOutput.getMinimum();
          maximum = fuzzyOutput.getMaximum();
  
          Type type = getType();
          if (type == Type.Automatic) {
              type = inferType(fuzzyOutput.getTerms().get(0));
          }
  
          double sum = 0.0;
          if (type == Type.TakagiSugeno) {
              double w, z;
              for (Activated activated : fuzzyOutput.getTerms()) {
                  w = activated.getDegree();
                  z = activated.getTerm().membership(w);
                  sum += w * z;
              }
          } else {
              double w, z;
              for (Activated activated : fuzzyOutput.getTerms()) {
                  w = activated.getDegree();
                  z = activated.getTerm().tsukamoto(w, minimum, maximum);
                  sum += w * z;
              }
          }
          return sum;
      }
docs: Computes the weighted sum of the given fuzzy set represented as an
  Aggregated term as `y = \sum_i{w_iz_i} `, where `w_i` is the
  activation degree of term `i`, and `z_i = \mu_i(w_i) `.
  
  From version 6.0, the implication and aggregation operators are not
  utilized for defuzzification.
  
  @param term is the fuzzy set represented as an AggregatedTerm
  @param minimum is the minimum value of the range (only used for Tsukamoto)
  @param maximum is the maximum value of the range (only used for Tsukamoto)
  @return the weighted sum of the given fuzzy set