STA475 #2 (Fall 2024)C/C++

Java Python STA475 Assignment #2 (Fall 2024)

Instructions

Due date: Friday October 11th at 11:59pm

•  No-questions-asked grace period until Monday October 14th at 5pm

•  No late submissions will be accepted after this time

Where to submit:

•  Crowdmark:  Submit your answers to each question in correct space on Crowdmark

•  You can submit as many times as you like before the deadline

•  Email submissions will NOT be accepted

Other notes:

•  For some questions, you will need to use R; please include all code and relevant output in the pdf submission (make sure the code is visible in the pdf and doesn’t run out of the margins).  If the question asks you to answer a question based on R output, make sure your answer is easy for your TA to find (i.e. start with your answer, then have the code and output afterwards for reference).  Your TA should be able to understand your answer without looking at your and output (as appropriate), but may refer to these to better understand what you did.

•  While you may discuss questions with your classmates, you MUST submit independent work that you did yourself.  Students submitting identical solutions  (e.g. identical sen- tences, derivations steps, or chunks of code) will be investigated for violations of academic integrity.

•  If   you   believe   you’ve   found   a   typo   or   error   in   the   assignment,   please   email sta475@utoronto.ca  so  I  can  look  into  it  and  get  back  to  the  class  as  quickly  as possible.

Question 1 [8 points]

In this question, you will simulate time-to-event data with one binary predictor, where the log-rank test and Wilcoxon test yield different results at the 5% significance level.

(a) Simulate survival data for two groups (e.g. treatment and control), with at

least n = 100 in each group, where the log-rank test and Wilcoxon test yield

different results at the 5% significance level.  Provide the  R code you used to

simulate the data (make sure to include set.seed() at the beginning to ensure reproducibility)

# Set random seed for reproducibility

set.seed(475) # You can change the integer, but leave this line here

# Simulate survival data

(b) Use R to conduct a logrank test and report the p-value for the difference in

survival distributions between groups for the data you simulated in (a)?  Write 1-2 sentences summarizing your findings.

# Perform. logrank test

(c) Use R to conduct a Wilcoxon test and report the p-value for the difference in

survival distributions between groups for the data you simulated in (a)?  Write 1-2 sentences summarizing your findings.

# Perform. Wilcoxon (Breslow) test

(d) Plot the K-M estimates for the two groups in the data you simulated in (a).

(e) Write 2-3 sentences commenting on why the log-rank and Wilcoxon tests

yield different results for the data you simulated in (a), by making specific reference to the plot you produced in (d).

Question 2 [6 points]

The time to recurrence, in months, for patients on an existing and novel treatment for lung cancer is compared using the following model:

Y = log(T) = 1 + 2Z + 0.3W ,

where W has a standard logistic distribution and Z = I(novel treatment is administered).

(a) Derive an expression for P (T > t) in terms of t and z, based on the expression above and the distribution of W.

(b) Use your answer from part (a) to estimate the probability of remaining in remission for more than 1 year, both under the new and standard treatments.

(c) Use your answer from (a) to estimate the probability of remaining in remission for more than 2 years, both under the new and standard treatments.

(d) Write 1-3 sentences carefully interpreting the effect of the new treatment on the median time to remission.

Question 3 [12 points]

A software company is analyzing the time-to-failure of their operating system under different conditions. They fit an AFT model to study the effects of two predictors on the time until the first critical error occurs:  (1) system load (high/normal) and (2) a new optimization algorithm (present/absent). They obtain the following results:

1.  The acceleration factor for high system load compared to normal system load is 1/2.25, controlling for presence or absence of the optimization algorithm.

2.  The acceleration factor for systems using the new optimization algorithm compared to those without it is 1/0.8, controlling for the system load (high or normal)

3.  The  median  time-to-failure  for  systems  under  normal  load  without  the  optimization algorithm is 1000 hours.

Note:  The corrections in red relate to the clarification notes covered on Tues Oct 8th.  These values should lead to answers that make more intuitive sense, in terms of the impact of heavy load vs  normal  load,  and  using  an optimizing  algorithm vs  no optimizing  algorithm.   The original values essentially had the wrong ”baseline” group.  It’s possible that if you leaned on your intuition, your answers may have been correct even with the original values.

(a) What is the response of interest in this problem?

(b) In this context, are longer values of the response variable desirable (e.g. good) or undesirable (e.g. bad)?  Explain your reasoning.

(c) Carefully interpret the effect of high system load on the time to first critical error in 2-3 sentences.  Make sure your answer includes a comment about whether or not high system load accelerates or delays the occurrence of critical errors.

(d) Carefully interpret the effect of the new optimization algorithm on the time to first

critical error in 2-3 sentences.  Make sure your answer includes a comment about

whether or not the new optimization algorithm accelerates or delays the occurrence of critical errors.

(e) Calculate the median time-to-failure for systems under high load without the optimization algorithm.

(f ) If 90% of systems under normal load without optimization survive for 500 hours without a critical error, how long do 90% of systems under normal load with optimization survive?

(g) What is the median time-to-failure for a system under high load with the new optimization algorithm?  Justify your answer by showing your calculations.

(h) The company wants to achieve a median time-to-failure of at least 800 hours for systems under high load.  Can this be achieved with the new optimization algorithm? Explain your reasoning.

Question 4 [9 points]

In this question, you’ll consider the diabetic retinopathy data we looked at in class.  In class, we fit several parametric models to these data, to model the time to blindness in the right eyes of diabetes patients, and here you will use several approaches to determine which model is most appropriate.

eyes <- diabetic |> filter(eye == "right")

(a) Fit weibull, exponential, lognormal, and log-logistic models to these data, with no predictors.

(b) Create one plot with the Kaplan-Meier estimate of the time to blindness in right eyes for these patients, as well as the parametric estimates for the models you fit in part (a).  Write 2-3 sentences summarizing what you learn from this plot.

Hint: You can modify the code from class to create this plot, and you can use the helper functions from class as well (you’ll find them on Quercus).

(c) Create a probability-probability (P-P) plot for each parametric model you fit

in (a). Write 2-3 sentences summarizing what you learn from this plot. Hint: You can modify the code from class to create this plot.

(d) What is one advantage of using the visualization approach from part (b) to choose a parametric model?

(e) What is one advantage of using the visualization approach from part (c) to choose a parametric model?

Question 5 [7 points]

library(tidyverse)

library(survival)

library(asaur)

hepatoCellular %>%

select(Number, Age, Gender, OS, Death, RFS, Recurrence) %>%

glimpse()

Rows: 227

Columns: 7

$ Number      1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ~

$ Age         57, 58, 65, 54, 71, 32, 79, 27, 55, 35, 34, 60, 38, 72, 41,~

$ Gender     0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1,~

$ OS          83, 81, 79, 76, 7, 13, 38, 19, 4, 76, 3, 78, 8, 72, 63, 33,~

$ Death       0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1,~

$ RFS         13, 81, 79, 76, 3, 3, 30, 19, 4, 76, 1, 78, 1, 72, 35, 33, ~

$ Recurrence  1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1,~

(a) Fit a Weibull model to estimate the survival curve for overall survival of

patients with hepatocellular carcinoma based on the hepatoCellular data.  Print a summary of your fitted model.

(b) Fit an exponential model to estimate the survival curve for overall survival of patients with hepatocellular carcinoma based on the hepatoCellular data. Print a summary of your fitted model.

(c) Conduct a likelihood ratio test to determine whether the exponential model is suitable to represent these data, compared to the Weibull model.  State your null and alternative hypotheses (be sure to define any parameters you refer to), write the form of the test statistic, calculate the test statistic and p-value using R, and write 1-2 sentences summarising your findings.

(d) In the likelihood ratio test you conducted above, how many degrees of freedom did you use for the chi-squared distribution?  Explain why in  1-2 sentences.

Question 6 [10 points]

Using the pharmacoSmoking data from the asaur package you will investigate the effect of triple therapy (grp == combination) vs patch (grp == patchOnly) treatments for smoking cessation. The response of interest is time (in days) until relapse of smoking.  We will exclude individuals from this analysis who did not quit smoking for at least one day

library(asaur)

glimpse(pharmacoSmoking)

Rows: 125

Columns: 14

$ id            21, 113, 39, 80, 87, 29, 16, 35, 54, 70, 84, 85, 25, 47~

$ ttr            182, 14, 5, 16, 0, 182, 14, 77, 2, 0, 12, 182, 21, 3, 1~

$ relapse        0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1~

$ grp             patchOnly, patchOnly, combination, combination, combina~

$ age             36, 41, 25, 54, 45, 43, 66, 78, 40, 38, 64, 51, 37, 65,~

$ gender          Male, Male, Female, Male, Male, Male, Male, Female, Fem~

$ race            white, white, white, white, white, hispanic, black, bla~

$ employment      ft, other, other, ft, other, ft, pt, other, ft, ft, oth~

$ yearsSmoking    26, 27, 12, 39, 30, 30, 54, 56, 25, 23, 30, 35, 23, 50,~

$ levelSmoking    heavy, heavy, heavy, heavy, heavy, heavy, heavy, light,~

$ ageGroup2       21-49, 21-49, 21-49, 50+, 21-49, 21-49, 50+, 50+, 21-49~

$ ageGroup4       35-49, 35-49, 21-34, 50-64, 35-49, 35-49, 65+, 65+, 35-~

$ priorAttempts   0, 3, 3, 0, 0, 2, 0, 10, 4, 10, 12, 1, 5, 6, 5, 2, 1, 1~

$ longestNoSmoke 0, 90, 21, 0, 0, 1825, 0, 15, 7, 90, 365, 7, 1095, 180,~

pharmacoSmoking <- pharmacoSmoking %>%

filter(ttr >= 1)

(a) You will first fit Weibull and lognormal models to these data (overall, not separated by treatment) and produce one or more plots of your choice to identify which of the parametric models is most suitable for these data (among these two choices).  Explain your answer in 1-2 sentences, making specific references to the plot(s) you produced.

(b) Using the parametric model you chose in part (a), fit two separate models, one for

each treatment group. What are the estimated values of a and τ for each group?

(c) Conduct hypothesis test(s) to determine whether the two groups have different survival distributions.  Be sure to formally state your null and alternative hypotheses, report relevant test statistics and p-values, and interpret your conclusions         

请将对话命名为:NS3 射频配置仿真。请参考以下代码:/* * Copyright (c) 2016 SEBASTIEN DERONNE * * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Deronne <sebastien.deronne@gmail.com> */ /* 头文件包含区域 */ /* 包含NS3核心库的头文件 */ #include "ns3/attribute-container.h" #include "ns3/boolean.h" #include "ns3/command-line.h" #include "ns3/config.h" #include "ns3/double.h" #include "ns3/enum.h" #include "ns3/he-phy.h" // 802.11ax物理层相关 #include "ns3/internet-stack-helper.h" #include "ns3/ipv4-address-helper.h" #include "ns3/ipv4-global-routing-helper.h" #include "ns3/log.h" #include "ns3/mobility-helper.h" #include "ns3/multi-model-spectrum-channel.h" // 频谱信道模型 #include "ns3/on-off-helper.h" // 开关流量应用 #include "ns3/packet-sink-helper.h" // 数据包接收器 #include "ns3/packet-sink.h" #include "ns3/spectrum-wifi-helper.h" // 频谱WiFi帮助类 #include "ns3/ssid.h" // SSID标识 #include "ns3/string.h" #include "ns3/udp-client-server-helper.h" // UDP客户端/服务器 #include "ns3/udp-server.h" #include "ns3/uinteger.h" #include "ns3/wifi-acknowledgment.h" // WiFi确认机制 #include "ns3/yans-wifi-channel.h" // Yans WiFi信道 #include "ns3/yans-wifi-helper.h" // Yans WiFi帮助类 #include <algorithm> // STL算法库 #include <functional> // 函数对象 /* * 主程序说明: * 这是一个IEEE 802.11ax(Wi-Fi 6)网络性能测试示例 * 主要功能: * - 测试不同MCS值(0-11)、信道带宽(20/40/80/160MHz)和保护间隔(800/1600/3200ns)下的吞吐量 * - 支持UDP和TCP流量 * - 支持上下行流量配置 * - 支持OFDMA和多用户调度 */ using namespace ns3; // 使用ns3命名空间 NS_LOG_COMPONENT_DEFINE("he-wifi-network"); // 定义日志组件 /* 主函数 */ int main(int argc, char* argv[]) { /* 参数初始化(带默认值) */ bool udp{true}; // 默认使用UDP协议 Time simulationTime{"30s"}; // 默认仿真时间10秒 double frequency{5}; // 默认工作频段5GHz (2.4/5/6GHz可选) int channelWidth{80}; // 信道带宽(-1表示未设置) int guardInterval{800}; // 保护间隔(-1表示未设置) int mcs{7}; uint32_t payloadSize = 1400; // 应用层负载大小(字节) bool rateControl = true; // 1 MinstrelHt或0 FixedRate uint32_t gridSize = 3; // 网格尺寸(2x2) double apSpacing = 300.0; // AP间距() double staDistance = 5.0; // AP-STA间距() /* 命令行参数解析 */ CommandLine cmd(__FILE__); cmd.AddValue("frequency", "工作频段(2.4/5/6 GHz)", frequency); cmd.AddValue("simulationTime", "仿真时长", simulationTime); cmd.AddValue("udp", "1=UDP, 0=TCP", udp); cmd.AddValue("channelWidth", "测试信道带宽(20/40/80/160 MHz)", channelWidth); cmd.AddValue("guardInterval", "测试保护间隔(800/1600/3200 ns)", guardInterval); cmd.AddValue("payloadSize", "应用层负载大小(字节)", payloadSize); cmd.AddValue("mcs", "mcs值", mcs); cmd.AddValue("apSpacing", "apSpacing值", apSpacing); cmd.AddValue("rate", "速率算法:MinstrelHt或FixedRate", rateControl); cmd.Parse(argc, argv); // 解析命令行参数 /* 主测试循环 */ /* TCP分段大小设置 */ if (!udp) { Config::SetDefault("ns3::TcpSocket::SegmentSize", UintegerValue(payloadSize)); } /* 节点创建 */ NodeContainer wifiStaNodes; // 站点节点 wifiStaNodes.Create(gridSize * gridSize); NodeContainer wifiApNodes; // AP节点 wifiApNodes.Create(gridSize * gridSize); /* 网络设备容器 */ NetDeviceContainer apDevices; // AP设备 NetDeviceContainer staDevices; // 站点设备 WifiMacHelper mac; // MAC层助手 WifiHelper wifi; // WiFi助手 /* 移动模型设置 */ MobilityHelper mobility; mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel"); // 固定位置模型 // AP位置 - 网格布局 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>(); for (uint32_t i = 0; i < gridSize; i++) { for (uint32_t j = 0; j < gridSize; j++) { positionAlloc->Add(Vector(i * apSpacing, j * apSpacing, 0.0)); } } mobility.SetPositionAllocator(positionAlloc); mobility.Install(wifiApNodes); // STA位置 - 每个STA靠近其AP positionAlloc = CreateObject<ListPositionAllocator>(); for (uint32_t i = 0; i < gridSize; i++) { for (uint32_t j = 0; j < gridSize; j++) { positionAlloc->Add(Vector(i * apSpacing + staDistance, j * apSpacing, 0.0)); } } mobility.SetPositionAllocator(positionAlloc); mobility.Install(wifiStaNodes); /* 信道设置字符串 */ std::string channelStr("{0, " + std::to_string(channelWidth) + ", "); /* 构造数据模式字符串 */ StringValue ctrlRate; // 控制速率 auto nonHtRefRateMbps = HePhy::GetNonHtReferenceRate(mcs) / 1e6; // 计算非HT参考速率 std::ostringstream ossDataMode; ossDataMode << "HeMcs" << mcs; /* 频段相关配置 */ if (frequency == 6) // 6GHz频段 { ctrlRate = StringValue(ossDataMode.str()); channelStr += "BAND_6GHZ, 0}"; Config::SetDefault("ns3::LogDistancePropagationLossModel::ReferenceLoss", DoubleValue(48)); } else if (frequency == 5) // 5GHz频段 { std::ostringstream ossControlMode; ossControlMode << "OfdmRate" << nonHtRefRateMbps << "Mbps"; ctrlRate = StringValue(ossControlMode.str()); channelStr += "BAND_5GHZ, 0}"; } else if (frequency == 2.4) // 2.4GHz频段 { std::ostringstream ossControlMode; ossControlMode << "ErpOfdmRate" << nonHtRefRateMbps << "Mbps"; ctrlRate = StringValue(ossControlMode.str()); channelStr += "BAND_2_4GHZ, 0}"; Config::SetDefault("ns3::LogDistancePropagationLossModel::ReferenceLoss", DoubleValue(40)); } else { NS_FATAL_ERROR("错误的频段值!"); } /* WiFi标准设置 */ wifi.SetStandard(WIFI_STANDARD_80211ax); // 使用802.11ax标准 /* 速率管理器配置 */ if (!rateControl) { // 固定速率设置 wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode", StringValue(ossDataMode.str()), "ControlMode", ctrlRate); } else { // 默认使用MinstrelHt wifi.SetRemoteStationManager("ns3::MinstrelHtWifiManager"); mcs = 7; // 自动速率算法默认配置最高的负载 } /* 保护间隔配置 */ wifi.ConfigHeOptions("GuardInterval", TimeValue(NanoSeconds(guardInterval))); /* 网络标识设置 */ /* 创建Yans信道 */ auto channel = YansWifiChannelHelper::Default(); YansWifiPhyHelper phy; phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO); phy.SetChannel(channel.Create()); phy.Set("ChannelSettings", StringValue(channelStr)); /* 站点MAC配置 */ std::vector<Ssid> apSsidList; // 存储所有AP的SSID for (uint32_t i = 0; i < wifiApNodes.GetN(); i++) { std::string ssidStr = "competition-ssid-" + std::to_string(i); Ssid ssid = Ssid(ssidStr); // std::cout << ssidStr << std::endl; apSsidList.push_back(ssid); // 创建单个AP WifiMacHelper apMac; apMac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid)); NetDeviceContainer apDevice = wifi.Install(phy, apMac, wifiApNodes.Get(i)); apDevices.Add(apDevice); } // 为每个STA设置对应的唯一SSID for (uint32_t i = 0; i < wifiStaNodes.GetN(); i++) { // 为STA设置对应的AP SSID WifiMacHelper staMac; staMac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(apSsidList[i]), "ActiveProbing", BooleanValue(false)); // 安装设备 NetDeviceContainer staDevice = wifi.Install(phy, staMac, wifiStaNodes.Get(i)); staDevices.Add(staDevice); } /* int64_t streamNumber = 150; streamNumber += WifiHelper::AssignStreams(apDevices, streamNumber); streamNumber += WifiHelper::AssignStreams(staDevices, streamNumber); 随机流分配 */ /* 协议栈安装 */ InternetStackHelper stack; stack.Install(wifiApNodes); stack.Install(wifiStaNodes); //streamNumber += stack.AssignStreams(wifiApNodes, streamNumber); //streamNumber += stack.AssignStreams(wifiStaNodes, streamNumber); /* IP地址分配 - 每个AP-STA对独立子网 */ Ipv4AddressHelper address; Ipv4InterfaceContainer apNodeInterfaces, staNodeInterfaces; for (uint32_t i = 0; i < gridSize * gridSize; i++) { std::string base = "10.1." + std::to_string(i + 1) + ".0"; address.SetBase(base.c_str(), "255.255.255.0"); // AP设备 NetDeviceContainer apDevice(apDevices.Get(i)); apNodeInterfaces.Add(address.Assign(apDevice)); // 对应的STA设备 NetDeviceContainer staDevice(staDevices.Get(i)); staNodeInterfaces.Add(address.Assign(staDevice)); } /* 流量生成设置 */ ApplicationContainer serverApps,clientApps; // 服务器应用容器 Ipv4InterfaceContainer serverInterfaces; // 服务器接口 NodeContainer clientNodes; // 客户端节点 /* 确定服务器和客户端 */ for (uint32_t i = 0; i < gridSize * gridSize; i++) { serverInterfaces.Add(staNodeInterfaces.Get(i)); clientNodes.Add(wifiApNodes.Get(i)); } /* 计算最大负载能力 */ const auto maxLoad = HePhy::GetDataRate(mcs, MHz_u{static_cast<double>(channelWidth)}, NanoSeconds(guardInterval), 1); for (uint32_t i = 0; i < gridSize * gridSize; i++) { /* 流量生成 */ if (udp) // UDP流量 { uint16_t port = 9; // UDP端口 UdpServerHelper server(port + i); // UDP服务器 serverApps.Add(server.Install(wifiStaNodes.Get(i))); //streamNumber += server.AssignStreams(wifiStaNodes.Get(i), streamNumber); /* 计算数据包间隔 */ const auto packetInterval = payloadSize * 8.0 / maxLoad; /* 安装UDP客户端 */ UdpClientHelper client(serverInterfaces.GetAddress(i), port + i); client.SetAttribute("MaxPackets", UintegerValue(4294967295U)); // 最大包数 client.SetAttribute("Interval", TimeValue(Seconds(packetInterval))); // 发送间隔 client.SetAttribute("PacketSize", UintegerValue(payloadSize)); // 包大小 clientApps.Add(client.Install(clientNodes.Get(i))); //streamNumber += client.AssignStreams(clientNodes.Get(i), streamNumber); } else // TCP流量 { } } serverApps.Start(Seconds(0)); serverApps.Stop(simulationTime + Seconds(1)); clientApps.Start(Seconds(1)); // 延迟1秒启动 clientApps.Stop(simulationTime + Seconds(1)); /* 全局路由表初始化 */ // Simulator::Schedule(Seconds(0), &Ipv4GlobalRoutingHelper::PopulateRoutingTables); /* 仿真控制 */ Simulator::Stop(simulationTime + Seconds(1)); // 设置停止时间 Simulator::Run(); // 启动仿真 std::ofstream outputFile; std::ostringstream tmp; tmp << "udp=" << udp << " mcs=" << mcs << " rate=" << rateControl << " Width=" << channelWidth << " apSpacing=" << apSpacing << " GI=" << guardInterval; outputFile.open(tmp.str().c_str(), std::ios::out); /* 结果处理 */ auto rxBytes = 0.0; // 接收总字节数 /* 计算接收字节数 */ if (udp) { for (uint32_t i = 0; i < serverApps.GetN(); i++) { int singlerxBytes = payloadSize * DynamicCast<UdpServer>(serverApps.Get(i))->GetReceived(); //std::cout << +(i+1) <<"号server吞吐率:\t"<< singlerxBytes << "Mbps" << std::endl; outputFile << +(i+1) <<"号server吞吐率:\t"<< (singlerxBytes*8 / simulationTime.GetMicroSeconds()) << "Mbps" << std::endl; rxBytes += singlerxBytes; } } else { for (uint32_t i = 0; i < serverApps.GetN(); i++) { rxBytes += DynamicCast<PacketSink>(serverApps.Get(i))->GetTotalRx(); } } /* 计算吞吐量(Mbps) */ auto throughput = (rxBytes * 8) / simulationTime.GetMicroSeconds(); // 比特/微秒 = Mbps /* std::cout << "UDP\t\tMCS value\t\trateControl\t\tChannel width\t\tApSpacing\t\tGI\t\t\tThroughput\n"; std::cout << +udp << "\t\t" << +mcs << "\t\t\t" << +rateControl << "\t\t\t" << +channelWidth << " MHz\t\t\t" << +apSpacing << " M\t\t\t" << guardInterval << " ns\t\t\t" << throughput << " Mbit/s" << std::endl; 输出表头和结果 */ outputFile << "UDP\t\tMCS value\t\trateControl\t\tChannel width\t\tapSpacing\t\tGI\t\t\tThroughput\n"; outputFile << +udp << "\t\t" << +mcs << "\t\t\t\t" << +rateControl << "\t\t\t" << +channelWidth << " MHz\t\t\t" << +apSpacing << " M\t\t\t" << guardInterval << " ns\t\t\t" << throughput << " Mbit/s" << std::endl; outputFile.flush(); outputFile.close(); Simulator::Destroy(); // 销毁仿真器 return 0; } 基于这份代码修改,让每个ap关联四个sta,并且增加一个干扰ap,请给我一份完整的可运行的仿真
09-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值