public void GenerateXofPacketTrick(object sender, EventArgs e) { if (PublicStatistics.InQueuePackets <= 0) { if (PublicStatistics.GeneratedPacketsCount >= Settings.Default.NumberofPackets) { RandomSelectSourceNodeTimer.Stop(); RandomSelectSourceNodeTimer.Interval = TimeSpan.FromSeconds(0); Settings.Default.NumberofPackets = 0; } else { // generate more: selector.RandomlySourceVechicle(Settings.Default.DistanceImportance, Settings.Default.DistanceBetweenSourceAndDestination); } } }
/// <summary> /// generate packet according to the rate. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GeneratePacket_to_rate(object sender, EventArgs e) { selector.RandomlySourceVechicle(Settings.Default.DistanceImportance, Settings.Default.DistanceBetweenSourceAndDestination); }