Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }