(A.) Objectives
(B.) Key Performance Metrics
(C.) Background
The experiment is part of an assignment based on the existing “wifi-example-sim.cc” in ns-3.38.
Release
used: ns-3.38. Files co hosted in the same scratch folder:
- wifi-example-apps.h
- wifi-example-apps.cc
- CMakeLists.txt
- scratch-simulator.cc
(D.) Steps Taken
(E.) Issues Encountered
Class Method Errors: I encountered multiple errors related to the use of TimeMinMaxAvgTotalCalculator class methods.
(F.) My Current Understanding
It appears that the TimeMinMaxAvgTotalCalculator class does not have methods like GetMean, GetSum, or GetCount. It only provides specific statistical methods, which are:
Given this, it appears that the correct approach to calculate the average delay is to use the GetMean method correctly, by ensuring that the TimeMinMaxAvgTotalCalculator is being used properly within the simulation.
However, I have attempted to use the GetMean approach, but yet getting the errors (see the example below) .
(G.) Support Required
Please is there anyone who can help:
1. To guide me on how to calculate the average delay for for WiFi Distance Experiment in ns-3 Simulation
2. To guide me on how to ensure that the TimeMinMaxAvgTotalCalculator is being used properly within the simulation.
3. To provide me any alternative approach to meet the same requirement.
(H.) Outcome of the Steps I have Taken:
error: ‘class ns3::TimeMinMaxAvgTotalCalculator’ has no member named ‘xxxx’
Example:
------------------------------------------------------------------------------------------------
~/ns-allinone-3.38/ns-3.38$ ./ns3 build
Scanning dependencies of target scratch_wifi-example-sim
[ 0%] Building CXX object scratch/CMakeFiles/scratch_wifi-example-sim.dir/wifi-example-sim.cc.o
ns-allinone-3.38/ns-3.38/scratch/wifi-example-sim.cc: In function ‘void RunSimulation(double, std::string, ns3::Ptr<ns3::CounterCalculator<unsigned int> >, ns3::Ptr<ns3::TimeMinMaxAvgTotalCalculator>, ns3::Ptr<ns3::CounterCalculator<unsigned int> >)’:
ns-allinone-3.38/ns-3.38/scratch/wifi-example-sim.cc:186:38: error: ‘class ns3::TimeMinMaxAvgTotalCalculator’ has no member named ‘getMean’
186 | double averageDelay = delayStat->getMean().ToDouble(Time::S); // Corrected method
| ^~~~~~~
/ns-allinone-3.38/ns-3.38/scratch/wifi-example-sim.cc: In function ‘int main(int, char**)’:
/ns-allinone-3.38/ns-3.38/scratch/wifi-example-sim.cc:252:46: error: ‘class ns3::TimeMinMaxAvgTotalCalculator’ has no member named ‘getMean’
252 | double averageDelay = delayStat->getMean().ToDouble(Time::S); // Corrected method
| ^~~~~~~
make[2]: *** [scratch/CMakeFiles/scratch_wifi-example-sim.dir/build.make:65: scratch/CMakeFiles/scratch_wifi-example-sim.dir/wifi-example-sim.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:18079: scratch/CMakeFiles/scratch_wifi-example-sim.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Finished executing the following commands:
cd cmake-cache; /usr/bin/cmake --build . -j 3 ; cd ..
-------------------------------------------------------------------------------------------------------