public double computeDynamicCutoff() {
    { IncrementalPartialMatch self = this;

      { IncrementalPartialMatch parent = ((IncrementalPartialMatch)(self.parent));
        double cutoff = 0.0;

        if (parent != null) {
          if (parent.kind == Logic.KWD_AND) {
            { double pcutoff = parent.dynamicCutoff;
              double totweight = parent.totalWeight;
              double propweight = self.propositionWeight(self.controlFrame.proposition);
              double weight = ((propweight == Stella.NULL_FLOAT) ? 1.0 : (((propweight < 0.1) ? 0.1 : propweight)));
              double maxother = (totweight - parent.accumulatedWeight) - weight;
              double unscaledcutoff = ((pcutoff * totweight) - parent.accumulatedScore) - maxother;

              cutoff = unscaledcutoff / weight;
            }
          }
          else {
            cutoff = parent.dynamicCutoff;
          }
          if ((cutoff < 0.0) &&
              (!self.controlFrame.reversePolarityP)) {
            cutoff = 0.0;
          }
          else if ((cutoff > 0.0) &&
              self.controlFrame.reversePolarityP) {
            cutoff = 0.0;
          }
          else if (!(self.controlFrame.reversePolarityP == parent.controlFrame.reversePolarityP)) {
            cutoff = 0 - cutoff;
          }
        }
        return (cutoff);
      }
    }
  }