Stats remove ns3 nan symbol

This commit is contained in:
jaredivey
2024-12-12 20:37:57 +00:00
committed by Eduardo Almeida
parent 538087738d
commit 86fb3ce8c4
6 changed files with 30 additions and 25 deletions

View File

@@ -25,6 +25,7 @@ This file is a best-effort approach to solving this issue; we will do our best b
* (applications) Deprecated attributes `RemoteAddress` and `RemotePort` in UdpClient, UdpTraceClient and UdpEchoClient. They have been combined into a single `Remote` attribute.
* (applications) Deprecated attributes `ThreeGppHttpClient::RemoteServerAddress` and `ThreeGppHttpClient::RemoteServerPort`. They have been combined into a single `ThreeGppHttpClient::Remote` attribute.
* (stats) Deprecated ns3::NaN and ns3::isNaN to use std::nan and std::isnan in their place
* (wifi) Added a new **ProtectedIfResponded** attribute to `FrameExchangeManager` to disable RTS/CTS protection for stations that have already responded to a frame requiring acknowledgment in the same TXOP, even if such frame had not been protected by RTS/CTS. The default value is true, even though it represents a change with respect to the previous behavior, because it is likely a more realistic choice.
* (wifi) Deprecated setters/getters of the {Ht,Vht,He}Configuration classes that trivially set/get member variables, which have been made public and hence accessible to users.

View File

@@ -158,12 +158,12 @@ MinMaxAvgTotalCalculator<T>::MinMaxAvgTotalCalculator()
m_total = 0;
m_squareTotal = 0;
m_meanCurr = NaN;
m_sCurr = NaN;
m_varianceCurr = NaN;
m_meanCurr = std::nan("");
m_sCurr = std::nan("");
m_varianceCurr = std::nan("");
m_meanPrev = NaN;
m_sPrev = NaN;
m_meanPrev = std::nan("");
m_sPrev = std::nan("");
}
template <typename T>
@@ -261,12 +261,12 @@ MinMaxAvgTotalCalculator<T>::Reset()
m_total = 0;
m_squareTotal = 0;
m_meanCurr = NaN;
m_sCurr = NaN;
m_varianceCurr = NaN;
m_meanCurr = std::nan("");
m_sCurr = std::nan("");
m_varianceCurr = std::nan("");
m_meanPrev = NaN;
m_sPrev = NaN;
m_meanPrev = std::nan("");
m_sPrev = std::nan("");
// end MinMaxAvgTotalCalculator::Reset
}

View File

@@ -15,8 +15,8 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE("DataCalculator");
static double zero = 0;
const double ns3::NaN = zero / zero;
// NS_DEPRECATED_3_44
const double ns3::NaN = std::nan("");
//--------------------------------------------------------------
//----------------------------------------------

View File

@@ -9,12 +9,14 @@
#ifndef DATA_CALCULATOR_H
#define DATA_CALCULATOR_H
#include "ns3/deprecated.h"
#include "ns3/nstime.h"
#include "ns3/object.h"
#include "ns3/simulator.h"
namespace ns3
{
NS_DEPRECATED_3_44("Use std::nan(\"\") instead")
extern const double NaN; //!< Stored representation of NaN
/**
@@ -22,10 +24,12 @@ extern const double NaN; //!< Stored representation of NaN
* @param x
* @return whether x is NaN
*/
NS_DEPRECATED_3_44("Use std::isnan() instead")
inline bool
isNaN(double x)
{
return x != x;
return std::isnan(x);
}
class DataOutputCallback;

View File

@@ -157,31 +157,31 @@ OmnetDataOutput::OmnetOutputCallback::OutputStatistic(std::string context,
name = "\"\"";
}
(*m_scalar) << "statistic " << context << " " << name << std::endl;
if (!isNaN(statSum->getCount()))
if (!std::isnan(statSum->getCount()))
{
(*m_scalar) << "field count " << statSum->getCount() << std::endl;
}
if (!isNaN(statSum->getSum()))
if (!std::isnan(statSum->getSum()))
{
(*m_scalar) << "field sum " << statSum->getSum() << std::endl;
}
if (!isNaN(statSum->getMean()))
if (!std::isnan(statSum->getMean()))
{
(*m_scalar) << "field mean " << statSum->getMean() << std::endl;
}
if (!isNaN(statSum->getMin()))
if (!std::isnan(statSum->getMin()))
{
(*m_scalar) << "field min " << statSum->getMin() << std::endl;
}
if (!isNaN(statSum->getMax()))
if (!std::isnan(statSum->getMax()))
{
(*m_scalar) << "field max " << statSum->getMax() << std::endl;
}
if (!isNaN(statSum->getSqrSum()))
if (!std::isnan(statSum->getSqrSum()))
{
(*m_scalar) << "field sqrsum " << statSum->getSqrSum() << std::endl;
}
if (!isNaN(statSum->getStddev()))
if (!std::isnan(statSum->getStddev()))
{
(*m_scalar) << "field stddev " << statSum->getStddev() << std::endl;
}

View File

@@ -158,23 +158,23 @@ SqliteDataOutput::SqliteOutputCallback::OutputStatistic(std::string key,
NS_LOG_FUNCTION(this << key << variable << statSum);
OutputSingleton(key, variable + "-count", static_cast<double>(statSum->getCount()));
if (!isNaN(statSum->getSum()))
if (!std::isnan(statSum->getSum()))
{
OutputSingleton(key, variable + "-total", statSum->getSum());
}
if (!isNaN(statSum->getMax()))
if (!std::isnan(statSum->getMax()))
{
OutputSingleton(key, variable + "-max", statSum->getMax());
}
if (!isNaN(statSum->getMin()))
if (!std::isnan(statSum->getMin()))
{
OutputSingleton(key, variable + "-min", statSum->getMin());
}
if (!isNaN(statSum->getSqrSum()))
if (!std::isnan(statSum->getSqrSum()))
{
OutputSingleton(key, variable + "-sqrsum", statSum->getSqrSum());
}
if (!isNaN(statSum->getStddev()))
if (!std::isnan(statSum->getStddev()))
{
OutputSingleton(key, variable + "-stddev", statSum->getStddev());
}