diff --git a/examples/wireless/ofdm-he-validation.cc b/examples/wireless/ofdm-he-validation.cc index 1a494b27d..62ee610ee 100644 --- a/examples/wireless/ofdm-he-validation.cc +++ b/examples/wireless/ofdm-he-validation.cc @@ -13,7 +13,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Sébastien Deronne + * Author: Sébastien Deronne */ // This example is used to validate NIST and YANS error rate models for VHT rates. @@ -73,17 +73,18 @@ int main (int argc, char *argv[]) for (double snr = -5.0; snr <= 40.0; snr += 0.1) { double ps = yans->GetChunkSuccessRate (WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8); - if (ps < 0 || ps > 1) + if (ps < 0.0 || ps > 1.0) { //error - return 0; + exit (1); } yansdataset.Add (snr, ps); + ps = nist->GetChunkSuccessRate (WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8); - if (ps < 0 || ps > 1) + if (ps < 0.0 || ps > 1.0) { //error - return 0; + exit (1); } nistdataset.Add (snr, ps); } diff --git a/examples/wireless/ofdm-ht-validation.cc b/examples/wireless/ofdm-ht-validation.cc index ea091e357..1d0791d6d 100644 --- a/examples/wireless/ofdm-ht-validation.cc +++ b/examples/wireless/ofdm-ht-validation.cc @@ -13,7 +13,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Sébastien Deronne + * Author: Sébastien Deronne */ // This example is used to validate NIST and YANS error rate models for HT rates. @@ -66,17 +66,18 @@ int main (int argc, char *argv[]) for (double snr = -5.0; snr <= 30.0; snr += 0.1) { double ps = yans->GetChunkSuccessRate (WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8); - yansdataset.Add (snr, ps); - if (ps < 0 || ps > 1) + if (ps < 0.0 || ps > 1.0) { //error - return 0; + exit (1); } + yansdataset.Add (snr, ps); + ps = nist->GetChunkSuccessRate (WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8); - if (ps < 0 || ps > 1) + if (ps < 0.0 || ps > 1.0) { //error - return 0; + exit (1); } nistdataset.Add (snr, ps); } diff --git a/examples/wireless/ofdm-validation.cc b/examples/wireless/ofdm-validation.cc index e1abee7ef..0f921d7d0 100644 --- a/examples/wireless/ofdm-validation.cc +++ b/examples/wireless/ofdm-validation.cc @@ -33,8 +33,8 @@ using namespace ns3; int main (int argc, char *argv[]) { uint32_t FrameSize = 1500; //bytes - std::ofstream yansfile ("yans-frame-success-rate.plt"); - std::ofstream nistfile ("nist-frame-success-rate.plt"); + std::ofstream yansfile ("yans-frame-success-rate-ofdm.plt"); + std::ofstream nistfile ("nist-frame-success-rate-ofdm.plt"); std::vector modes; modes.push_back ("OfdmRate6Mbps"); @@ -50,8 +50,8 @@ int main (int argc, char *argv[]) cmd.AddValue ("FrameSize", "The frame size in bytes", FrameSize); cmd.Parse (argc, argv); - Gnuplot yansplot = Gnuplot ("yans-frame-success-rate.eps"); - Gnuplot nistplot = Gnuplot ("nist-frame-success-rate.eps"); + Gnuplot yansplot = Gnuplot ("yans-frame-success-rate-ofdm.eps"); + Gnuplot nistplot = Gnuplot ("nist-frame-success-rate-ofdm.eps"); Ptr yans = CreateObject (); Ptr nist = CreateObject (); @@ -67,17 +67,18 @@ int main (int argc, char *argv[]) for (double snr = -5.0; snr <= 30.0; snr += 0.1) { double ps = yans->GetChunkSuccessRate (WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8); - yansdataset.Add (snr, ps); - if (ps < 0 || ps > 1) + if (ps < 0.0 || ps > 1.0) { //error - return 0; + exit (1); } + yansdataset.Add (snr, ps); + ps = nist->GetChunkSuccessRate (WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8); - if (ps < 0 || ps > 1) + if (ps < 0.0 || ps > 1.0) { //error - return 0; + exit (1); } nistdataset.Add (snr, ps); } diff --git a/examples/wireless/ofdm-vht-validation.cc b/examples/wireless/ofdm-vht-validation.cc index c63c7c3f6..f6aabb8b6 100644 --- a/examples/wireless/ofdm-vht-validation.cc +++ b/examples/wireless/ofdm-vht-validation.cc @@ -13,7 +13,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Sébastien Deronne + * Author: Sébastien Deronne */ // This example is used to validate NIST and YANS error rate models for VHT rates. @@ -67,17 +67,18 @@ int main (int argc, char *argv[]) for (double snr = -5.0; snr <= 30.0; snr += 0.1) { double ps = yans->GetChunkSuccessRate (WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8); - if (ps < 0 || ps > 1) + if (ps < 0.0 || ps > 1.0) { //error - return 0; + exit (1); } yansdataset.Add (snr, ps); + ps = nist->GetChunkSuccessRate (WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8); - if (ps < 0 || ps > 1) + if (ps < 0.0 || ps > 1.0) { //error - return 0; + exit (1); } nistdataset.Add (snr, ps); }