Exemplo n.º 1
0
        private void btn_from_all_Click(object sender, RoutedEventArgs e)
        {
            Settings.Default.KeepLogs = false;
            int NOD = Convert.ToInt16(com_num_of_deadNodes.Text);

            PublicParamerters.NOS = myNetWork.Count;
            PublicParamerters.NOP = 1;
            int round = 0;

            while (PublicParamerters.DeadNodeList.Count < NOD)
            {
                NetworkLifeTime Ran = new NetworkLifeTime();
                Ran.FromAllNodes(myNetWork);
                round++;
                PublicParamerters.Rounds = round;
                PublicParamerters.SinkNode.PacketsList.Clear();
            }

            UiNetworkLifetimeReport xx = new UiNetworkLifetimeReport();

            xx.Title = "Lifetime report";
            xx.dg_grid.ItemsSource = PublicParamerters.DeadNodeList;
            xx.Show();

            PublicParamerters.NOS = 0;
            PublicParamerters.NOP = 0;

            this.Close();
        }
Exemplo n.º 2
0
        private void btn_compute_life_time_Click(object sender, RoutedEventArgs e)
        {
            Settings.Default.KeepLogs = false;
            int NOD = Convert.ToInt16(com_NOD.Text);
            int NOS = Convert.ToInt16(com_nos.Text);
            int NOP = Convert.ToInt16(com_nop.Text);

            PublicParamerters.NOS = NOS;
            PublicParamerters.NOP = NOP;
            int round = 0;

            while (PublicParamerters.DeadNodeList.Count < NOD)
            {
                NetworkLifeTime Ran = new NetworkLifeTime();
                Ran.RandimSelect(myNetWork, NOS, NOP);
                round++;
                PublicParamerters.Rounds = round;
                PublicParamerters.SinkNode.PacketsList.Clear();
            }

            UiNetworkLifetimeReport xx = new UiNetworkLifetimeReport();

            xx.Title = "Lifetime report";
            xx.dg_grid.ItemsSource = PublicParamerters.DeadNodeList;
            xx.Show();

            PublicParamerters.NOS = 0;
            PublicParamerters.NOP = 0;

            this.Close();
        }