wifi: Avoid potential failures in the wifi-he-network example

This commit is contained in:
Stefano Avallone
2022-09-05 10:10:45 +02:00
parent b711d35cb2
commit 31bd09673d

View File

@@ -395,25 +395,31 @@ int main (int argc, char *argv[])
exit (1);
}
}
//test previous throughput is smaller (for the same mcs)
if (throughput * (1 + tolerance) > previous)
// Skip comparisons with previous cases if more than one stations are present
// because, e.g., random collisions in the establishment of Block Ack agreements
// have an impact on throughput
if (nStations == 1)
{
previous = throughput;
}
else if (throughput > 0)
{
NS_LOG_ERROR ("Obtained throughput " << throughput << " is not expected!");
exit (1);
}
//test previous throughput is smaller (for the same channel width and GI)
if (throughput * (1 + tolerance) > prevThroughput [index])
{
prevThroughput [index] = throughput;
}
else if (throughput > 0)
{
NS_LOG_ERROR ("Obtained throughput " << throughput << " is not expected!");
exit (1);
//test previous throughput is smaller (for the same mcs)
if (throughput * (1 + tolerance) > previous)
{
previous = throughput;
}
else if (throughput > 0)
{
NS_LOG_ERROR ("Obtained throughput " << throughput << " is not expected!");
exit (1);
}
//test previous throughput is smaller (for the same channel width and GI)
if (throughput * (1 + tolerance) > prevThroughput [index])
{
prevThroughput [index] = throughput;
}
else if (throughput > 0)
{
NS_LOG_ERROR ("Obtained throughput " << throughput << " is not expected!");
exit (1);
}
}
index++;
gi /= 2;