private double step1ToAvr(IMemFunc memFunc) { double num = 0.0; double den = 0.0; foreach (double step in memFunc.getElements(n)) { double avrBetvenLandU = (memFunc.lowerMemFunction(step) + memFunc.upperMemFunction(step)) / 2; num = num + step * avrBetvenLandU; den += avrBetvenLandU; } return(num / den); }
private double step3ForClOrCr(IMemFunc memFunc, int e, bool ifCr = false) { double num = 0.0; double den = 0.0; int z = 1; foreach (double step in memFunc.getElements(n)) { double avrBetvenLandU = (memFunc.lowerMemFunction(step) + memFunc.upperMemFunction(step)) / 2; double deltaBetvenLandU = (memFunc.lowerMemFunction(step) - memFunc.upperMemFunction(step)) / 2; if (ifCr) { int local = e; e = z; z = local; } double numberDipendOnClOrCr = 0; if (z <= e) { numberDipendOnClOrCr = avrBetvenLandU + deltaBetvenLandU; } else { numberDipendOnClOrCr = avrBetvenLandU - deltaBetvenLandU; } num += step * avrBetvenLandU; den += avrBetvenLandU; z++; } return(num / den); }
internal void calculateFiringInterval(double[] inputs) { int i = 0; List <double> muu = new List <double>(); List <double> mul = new List <double>(); foreach (double number in inputs) { IMemFunc memFunc = antc[i]; muu.Add(memFunc.upperMemFunction(number)); mul.Add(memFunc.lowerMemFunction(number)); i++; } firingInterval.calculateFiringInterval(muu, mul); }