Esempio n. 1
0
        public static List <UplinkFlowEnery> TestRvalue(int neiCount, int disPiovot)
        {
            List <UplinkFlowEnery> table = new List <UplinkFlowEnery>();
            // normalized values.
            double RSum = 0;

            for (int i = 1; i <= neiCount; i++)
            {
                RSum += disPiovot * i;
            }

            for (int i = 1; i <= neiCount; i++)
            {
                UplinkFlowEnery en = new UplinkFlowEnery();

                en.R  = disPiovot * i;
                en.RN = 1 - (Math.Pow(en.R, 1 + Settings.Default.ExpoRCnt) / RSum);
                table.Add(en);
            }

            // pro sum
            double RpSum = 0; // sum of h value.

            foreach (UplinkFlowEnery en in table)
            {
                RpSum += Math.Exp(en.RN);
            }

            foreach (UplinkFlowEnery en in table)
            {
                en.RP = Math.Exp(en.RN) / RpSum;
            }
            return(table);
        }
Esempio n. 2
0
        public static List <UplinkFlowEnery> TestLvalue(int neiCount, int disPiovot)
        {
            List <UplinkFlowEnery> table = new List <UplinkFlowEnery>();

            // normalized values.



            for (int i = 1; i <= neiCount; i++)
            {
                UplinkFlowEnery en = new UplinkFlowEnery();
                en.L  = i * disPiovot;
                en.LN = Math.Pow(en.L / 100, Settings.Default.ExpoLCnt);
                table.Add(en);
            }

            // pro sum
            double LpSum = 0;

            foreach (UplinkFlowEnery en in table)
            {
                LpSum += (1 - Math.Exp(-en.LN));
            }

            foreach (UplinkFlowEnery en in table)
            {
                en.LP = (1 - Math.Exp(-en.LN)) / LpSum;
            }
            return(table);
        }
Esempio n. 3
0
        /// <summary>
        ///  en.H = (i * Hpiovot);
        /// </summary>
        /// <param name="neigCount"></param>
        /// <param name="Hpiovot"></param>
        /// <returns></returns>
        public static List <UplinkFlowEnery> TestHvalue(int neigCount, int Hpiovot)
        {
            List <UplinkFlowEnery> table = new List <UplinkFlowEnery>();

            // normalized values.

            for (int i = 1; i <= neigCount; i++)
            {
                UplinkFlowEnery en = new UplinkFlowEnery();
                en.Current = new Dataplane.Sensor(0);
                en.Next    = new Dataplane.Sensor(1);
                en.H       = (i * Hpiovot);
                en.HN      = 1.0 / (Math.Pow((Convert.ToDouble(en.H) + 1.0), 1 + Settings.Default.ExpoHCnt));
                table.Add(en);
            }

            // pro sum
            double HpSum = 0; // sum of h value.

            foreach (UplinkFlowEnery en in table)
            {
                HpSum += (1 - Math.Exp(en.HN));
            }

            foreach (UplinkFlowEnery en in table)
            {
                en.HP = (1 - Math.Exp(en.HN)) / HpSum;
            }
            return(table);
        }