Esempio n. 1
0
        public DoEnergyConsmption1Experment(List <Sensor> nET, int _NumPackets)
        {
            NETWORK    = nET;
            NumPackets = _NumPackets;
            Distances.Add(d50Str);
            Distances.Add(d100Str);
            Distances.Add(d150Str);
            Distances.Add(d200Str);
            Distances.Add(d250Str);


            foreach (string distance in Distances)
            {
                EnergyConsmption1 x = new EnergyConsmption1();
                x.Number_of_Packets_tobe_Sent = _NumPackets;
                x.Distance = Convert.ToInt32(distance.Split('-')[0]); // distance.
                string   nodesStr = distance.Split('-')[1];
                string[] nodes    = nodesStr.Split(',');
                foreach (string node in nodes)
                {
                    if (node.ToString() != "")
                    {
                        int id = Convert.ToInt16(node);
                        x.Nodes.Add(NETWORK[id]);
                    }
                }
                Results.Add(x);
            }
        }
Esempio n. 2
0
 private void SumEffeciancyAndConsumption(EnergyConsmption1 exp)
 {
     foreach (ProZoneRouting.DataPacket.Datapacket pa in PublicParamerters.SinkNode.PacketsList)
     {
         exp.EnergyConsumption    += pa.UsedEnergy_Joule;
         exp.SumRoutingEfficiency += pa.RoutingEfficiency;
     }
 }