diff -r a3afed368709 bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py Wed Jul 07 23:58:40 2010 +0900 +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py Wed Jul 07 19:23:30 2010 -0400 @@ -12,7 +12,7 @@ ## nstime.h: ns3::TimeUnit<-1> [class] module.add_class('TimeInvert') ## nstime.h: ns3::TimeUnit<0> [class] - module.add_class('Scalar') + module.add_class('Dimensionless') ## nstime.h: ns3::TimeUnit<1> [class] module.add_class('Time') ## nstime.h: ns3::TimeUnit<2> [class] @@ -63,15 +63,15 @@ module.add_class('TimeChecker', parent=root_module['ns3::AttributeChecker']) ## nstime.h: ns3::TimeValue [class] module.add_class('TimeValue', parent=root_module['ns3::AttributeValue']) + typehandlers.add_type_alias('ns3::TimeUnit< 0 >', 'ns3::Dimensionless') + typehandlers.add_type_alias('ns3::TimeUnit< 0 >*', 'ns3::Dimensionless*') + typehandlers.add_type_alias('ns3::TimeUnit< 0 >&', 'ns3::Dimensionless&') typehandlers.add_type_alias('ns3::TimeUnit< 2 >', 'ns3::TimeSquare') typehandlers.add_type_alias('ns3::TimeUnit< 2 >*', 'ns3::TimeSquare*') typehandlers.add_type_alias('ns3::TimeUnit< 2 >&', 'ns3::TimeSquare&') typehandlers.add_type_alias('ns3::TimeUnit< - 1 >', 'ns3::TimeInvert') typehandlers.add_type_alias('ns3::TimeUnit< - 1 >*', 'ns3::TimeInvert*') typehandlers.add_type_alias('ns3::TimeUnit< - 1 >&', 'ns3::TimeInvert&') - typehandlers.add_type_alias('ns3::TimeUnit< 0 >', 'ns3::Scalar') - typehandlers.add_type_alias('ns3::TimeUnit< 0 >*', 'ns3::Scalar*') - typehandlers.add_type_alias('ns3::TimeUnit< 0 >&', 'ns3::Scalar&') typehandlers.add_type_alias('ns3::TimeUnit< 1 >', 'ns3::Time') typehandlers.add_type_alias('ns3::TimeUnit< 1 >*', 'ns3::Time*') typehandlers.add_type_alias('ns3::TimeUnit< 1 >&', 'ns3::Time&') @@ -173,7 +173,7 @@ register_Ns3HighPrecision_methods(root_module, root_module['ns3::HighPrecision']) register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator']) register_Ns3TimeInvert_methods(root_module, root_module['ns3::TimeInvert']) - register_Ns3Scalar_methods(root_module, root_module['ns3::Scalar']) + register_Ns3Dimensionless_methods(root_module, root_module['ns3::Dimensionless']) register_Ns3Time_methods(root_module, root_module['ns3::Time']) register_Ns3TimeSquare_methods(root_module, root_module['ns3::TimeSquare']) register_Ns3Timer_methods(root_module, root_module['ns3::Timer']) @@ -422,11 +422,11 @@ []) return -def register_Ns3Scalar_methods(root_module, cls): - cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Scalar'], param('ns3::TimeUnit< 1 > const &', 'right')) - cls.add_binary_numeric_operator('/', root_module['ns3::TimeInvert'], root_module['ns3::Scalar'], param('ns3::TimeUnit< 1 > const &', 'right')) - ## nstime.h: ns3::TimeUnit<0>::TimeUnit(double scalar) [constructor] - cls.add_constructor([param('double', 'scalar')]) +def register_Ns3Dimensionless_methods(root_module, cls): + cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Dimensionless'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_numeric_operator('/', root_module['ns3::TimeInvert'], root_module['ns3::Dimensionless'], param('ns3::TimeUnit< 1 > const &', 'right')) + ## nstime.h: ns3::TimeUnit<0>::TimeUnit(double dimensionless) [constructor] + cls.add_constructor([param('double', 'dimensionless')]) ## nstime.h: ns3::TimeUnit<0>::TimeUnit() [constructor] cls.add_constructor([]) ## nstime.h: ns3::TimeUnit<0>::TimeUnit(ns3::TimeUnit<0> const & o) [copy constructor] @@ -480,7 +480,7 @@ cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 0 > const &', 'right')) - cls.add_binary_numeric_operator('/', root_module['ns3::Scalar'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_numeric_operator('/', root_module['ns3::Dimensionless'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('>') cls.add_output_stream_operator() diff -r a3afed368709 bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py --- a/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py Wed Jul 07 23:58:40 2010 +0900 +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py Wed Jul 07 19:23:30 2010 -0400 @@ -12,7 +12,7 @@ ## nstime.h: ns3::TimeUnit<-1> [class] module.add_class('TimeInvert') ## nstime.h: ns3::TimeUnit<0> [class] - module.add_class('Scalar') + module.add_class('Dimensionless') ## nstime.h: ns3::TimeUnit<1> [class] module.add_class('Time') ## nstime.h: ns3::TimeUnit<2> [class] @@ -63,15 +63,15 @@ module.add_class('TimeChecker', parent=root_module['ns3::AttributeChecker']) ## nstime.h: ns3::TimeValue [class] module.add_class('TimeValue', parent=root_module['ns3::AttributeValue']) + typehandlers.add_type_alias('ns3::TimeUnit< 0 >', 'ns3::Dimensionless') + typehandlers.add_type_alias('ns3::TimeUnit< 0 >*', 'ns3::Dimensionless*') + typehandlers.add_type_alias('ns3::TimeUnit< 0 >&', 'ns3::Dimensionless&') typehandlers.add_type_alias('ns3::TimeUnit< 2 >', 'ns3::TimeSquare') typehandlers.add_type_alias('ns3::TimeUnit< 2 >*', 'ns3::TimeSquare*') typehandlers.add_type_alias('ns3::TimeUnit< 2 >&', 'ns3::TimeSquare&') typehandlers.add_type_alias('ns3::TimeUnit< - 1 >', 'ns3::TimeInvert') typehandlers.add_type_alias('ns3::TimeUnit< - 1 >*', 'ns3::TimeInvert*') typehandlers.add_type_alias('ns3::TimeUnit< - 1 >&', 'ns3::TimeInvert&') - typehandlers.add_type_alias('ns3::TimeUnit< 0 >', 'ns3::Scalar') - typehandlers.add_type_alias('ns3::TimeUnit< 0 >*', 'ns3::Scalar*') - typehandlers.add_type_alias('ns3::TimeUnit< 0 >&', 'ns3::Scalar&') typehandlers.add_type_alias('ns3::TimeUnit< 1 >', 'ns3::Time') typehandlers.add_type_alias('ns3::TimeUnit< 1 >*', 'ns3::Time*') typehandlers.add_type_alias('ns3::TimeUnit< 1 >&', 'ns3::Time&') @@ -173,7 +173,7 @@ register_Ns3HighPrecision_methods(root_module, root_module['ns3::HighPrecision']) register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator']) register_Ns3TimeInvert_methods(root_module, root_module['ns3::TimeInvert']) - register_Ns3Scalar_methods(root_module, root_module['ns3::Scalar']) + register_Ns3Dimensionless_methods(root_module, root_module['ns3::Dimensionless']) register_Ns3Time_methods(root_module, root_module['ns3::Time']) register_Ns3TimeSquare_methods(root_module, root_module['ns3::TimeSquare']) register_Ns3Timer_methods(root_module, root_module['ns3::Timer']) @@ -422,11 +422,11 @@ []) return -def register_Ns3Scalar_methods(root_module, cls): - cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Scalar'], param('ns3::TimeUnit< 1 > const &', 'right')) - cls.add_binary_numeric_operator('/', root_module['ns3::TimeInvert'], root_module['ns3::Scalar'], param('ns3::TimeUnit< 1 > const &', 'right')) - ## nstime.h: ns3::TimeUnit<0>::TimeUnit(double scalar) [constructor] - cls.add_constructor([param('double', 'scalar')]) +def register_Ns3Dimensionless_methods(root_module, cls): + cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Dimensionless'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_numeric_operator('/', root_module['ns3::TimeInvert'], root_module['ns3::Dimensionless'], param('ns3::TimeUnit< 1 > const &', 'right')) + ## nstime.h: ns3::TimeUnit<0>::TimeUnit(double dimensionless) [constructor] + cls.add_constructor([param('double', 'dimensionless')]) ## nstime.h: ns3::TimeUnit<0>::TimeUnit() [constructor] cls.add_constructor([]) ## nstime.h: ns3::TimeUnit<0>::TimeUnit(ns3::TimeUnit<0> const & o) [copy constructor] @@ -480,7 +480,7 @@ cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 0 > const &', 'right')) - cls.add_binary_numeric_operator('/', root_module['ns3::Scalar'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_numeric_operator('/', root_module['ns3::Dimensionless'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('>') cls.add_output_stream_operator() diff -r a3afed368709 bindings/python/wscript --- a/bindings/python/wscript Wed Jul 07 23:58:40 2010 +0900 +++ b/bindings/python/wscript Wed Jul 07 19:23:30 2010 -0400 @@ -314,10 +314,10 @@ t1 = t2 - t3; TimeSquare tsq = t2*t3; Time tsqdiv = tsq/Seconds(1); - Scalar scal = t2/t3; - TimeInvert inv = scal/t3; - t1 = scal*t1; - t1 = t1/scal; + Dimensionless dim = t2/t3; + TimeInvert inv = dim/t3; + t1 = dim*t1; + t1 = t1/dim; t1 < t2; t1 <= t2; t1 == t2; diff -r a3afed368709 src/applications/onoff/onoff-application.cc --- a/src/applications/onoff/onoff-application.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/applications/onoff/onoff-application.cc Wed Jul 07 19:23:30 2010 -0400 @@ -166,7 +166,7 @@ { // Cancel the pending send packet event // Calculate residual bits since last packet sent Time delta(Simulator::Now() - m_lastStartTime); - Scalar bits = delta * Scalar (m_cbrRate.GetBitRate ()) / Seconds (1.0); + Dimensionless bits = delta * Dimensionless (m_cbrRate.GetBitRate ()) / Seconds (1.0); m_residualBits += (uint32_t)bits.GetDouble (); } Simulator::Cancel(m_sendEvent); diff -r a3afed368709 src/contrib/delay-jitter-estimation.cc --- a/src/contrib/delay-jitter-estimation.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/contrib/delay-jitter-estimation.cc Wed Jul 07 19:23:30 2010 -0400 @@ -98,7 +98,7 @@ tag.GetTxTime (); Time delta = (Simulator::Now () - m_previousRx) - (tag.GetTxTime () - m_previousRxTx); - m_jitter += (Abs (delta) - m_jitter ) / Scalar (16.0); + m_jitter += (Abs (delta) - m_jitter ) / Dimensionless (16.0); m_previousRx = Simulator::Now (); m_previousRxTx = tag.GetTxTime (); m_delay = Simulator::Now () - tag.GetTxTime (); diff -r a3afed368709 src/contrib/flow-monitor/flow-probe.h --- a/src/contrib/flow-monitor/flow-probe.h Wed Jul 07 23:58:40 2010 +0900 +++ b/src/contrib/flow-monitor/flow-probe.h Wed Jul 07 19:23:30 2010 -0400 @@ -57,7 +57,7 @@ std::vector packetsDropped; /// bytesDropped[reasonCode] => number of dropped bytes std::vector bytesDropped; - /// divide by 'Scalar (packets)' to get the average delay from the + /// divide by 'Dimensionless (packets)' to get the average delay from the /// first (entry) probe up to this one (partial delay) Time delayFromFirstProbeSum; /// Number of bytes seen of this flow diff -r a3afed368709 src/contrib/stats/time-data-calculators.cc --- a/src/contrib/stats/time-data-calculators.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/contrib/stats/time-data-calculators.cc Wed Jul 07 19:23:30 2010 -0400 @@ -73,7 +73,7 @@ callback.OutputSingleton(m_context, m_key + "-count", m_count); if (m_count > 0) { callback.OutputSingleton(m_context, m_key + "-total", m_total); - callback.OutputSingleton(m_context, m_key + "-average", m_total/Scalar(m_count)); + callback.OutputSingleton(m_context, m_key + "-average", m_total/Dimensionless(m_count)); callback.OutputSingleton(m_context, m_key + "-max", m_max); callback.OutputSingleton(m_context, m_key + "-min", m_min); } diff -r a3afed368709 src/devices/csma/backoff.cc --- a/src/devices/csma/backoff.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/devices/csma/backoff.cc Wed Jul 07 19:23:30 2010 -0400 @@ -67,7 +67,7 @@ uint32_t backoffSlots = (uint32_t)m_rng.GetValue(minSlot, maxSlot); - backoff = Scalar(backoffSlots) * m_slotTime; + backoff = Dimensionless(backoffSlots) * m_slotTime; return (backoff); } diff -r a3afed368709 src/devices/mesh/dot11s/hwmp-protocol.cc --- a/src/devices/mesh/dot11s/hwmp-protocol.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc Wed Jul 07 19:23:30 2010 -0400 @@ -963,7 +963,7 @@ if (i == m_preqTimeouts.end ()) { m_preqTimeouts[dst].preqTimeout = Simulator::Schedule ( - m_dot11MeshHWMPnetDiameterTraversalTime * Scalar (2), + m_dot11MeshHWMPnetDiameterTraversalTime * Dimensionless (2), &HwmpProtocol::RetryPathDiscovery, this, dst, 1); m_preqTimeouts[dst].whenScheduled = Simulator::Now (); return true; @@ -1009,7 +1009,7 @@ i->second->RequestDestination (dst, originator_seqno, dst_seqno); } m_preqTimeouts[dst].preqTimeout = Simulator::Schedule ( - Scalar (2 * (numOfRetry + 1)) * m_dot11MeshHWMPnetDiameterTraversalTime, + Dimensionless (2 * (numOfRetry + 1)) * m_dot11MeshHWMPnetDiameterTraversalTime, &HwmpProtocol::RetryPathDiscovery, this, dst, numOfRetry); } //Proactive PREQ routines: diff -r a3afed368709 src/devices/spectrum/waveform-generator.cc --- a/src/devices/spectrum/waveform-generator.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/devices/spectrum/waveform-generator.cc Wed Jul 07 19:23:30 2010 -0400 @@ -173,7 +173,7 @@ void WaveformGenerator::SetDutyCycle (double dutyCycle) { - m_dutyCycle = Scalar (dutyCycle); + m_dutyCycle = Dimensionless (dutyCycle); } double WaveformGenerator::GetDutyCycle () const diff -r a3afed368709 src/devices/spectrum/waveform-generator.h --- a/src/devices/spectrum/waveform-generator.h Wed Jul 07 23:58:40 2010 +0900 +++ b/src/devices/spectrum/waveform-generator.h Wed Jul 07 19:23:30 2010 -0400 @@ -136,7 +136,7 @@ Ptr m_txPowerSpectralDensity; Time m_period; - Scalar m_dutyCycle; + Dimensionless m_dutyCycle; Time m_startTime; bool m_active; diff -r a3afed368709 src/devices/wifi/mac-low.cc --- a/src/devices/wifi/mac-low.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/devices/wifi/mac-low.cc Wed Jul 07 19:23:30 2010 -0400 @@ -987,7 +987,7 @@ { txTime += m_phy->CalculateTxDuration (GetRtsSize (), rtsMode, WIFI_PREAMBLE_LONG); txTime += GetCtsDuration (hdr->GetAddr1 (), rtsMode); - txTime += GetSifs () * Scalar (2); + txTime += GetSifs () * Dimensionless (2); } uint32_t dataSize = GetSize (packet, hdr); txTime += m_phy->CalculateTxDuration (dataSize, dataMode, WIFI_PREAMBLE_LONG); @@ -1047,7 +1047,7 @@ cts.SetType (WIFI_MAC_CTL_CTS); Time navCounterResetCtsMissedDelay = m_phy->CalculateTxDuration (cts.GetSerializedSize (), txMode, preamble) + - Scalar (2) * GetSifs () + Scalar (2) * GetSlotTime (); + Dimensionless (2) * GetSifs () + Dimensionless (2) * GetSlotTime (); m_navCounterResetCtsMissed = Simulator::Schedule (navCounterResetCtsMissedDelay, &MacLow::NavCounterResetCtsMissed, this, Simulator::Now ()); diff -r a3afed368709 src/devices/wimax/bs-uplink-scheduler-mbqos.cc --- a/src/devices/wimax/bs-uplink-scheduler-mbqos.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/devices/wimax/bs-uplink-scheduler-mbqos.cc Wed Jul 07 19:23:30 2010 -0400 @@ -314,7 +314,7 @@ uInterval = MilliSeconds ((*(ssRecord->GetServiceFlows (ServiceFlow::SF_TYPE_UGS).begin ()))->GetUnsolicitedGrantInterval ()); - Scalar frame = ((timestamp - Simulator::Now ()) / frame_duration); + Dimensionless frame = ((timestamp - Simulator::Now ()) / frame_duration); if (frame.GetDouble () <= 1) { @@ -668,7 +668,7 @@ Time deadline = job->GetDeadline (); Time frame_duration = GetBs ()->GetPhy ()->GetFrameDuration (); - Scalar frame = ((deadline - Simulator::Now ()) / frame_duration); + Dimensionless frame = ((deadline - Simulator::Now ()) / frame_duration); NS_LOG_DEBUG ("At " << Simulator::Now ().GetSeconds () << " reserved traffic rate: " << job->GetServiceFlow ()->GetMinReservedTrafficRate () diff -r a3afed368709 src/internet-stack/rtt-estimator.cc --- a/src/internet-stack/rtt-estimator.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/internet-stack/rtt-estimator.cc Wed Jul 07 19:23:30 2010 -0400 @@ -205,9 +205,9 @@ if (nSamples) { // Not first Time err = m - est; - est = est + Scalar (gain) * err; // estimated rtt + est = est + Dimensionless (gain) * err; // estimated rtt err = Abs (err); // absolute value of error - variance = variance + Scalar (gain) * (err - variance); // variance of rtt + variance = variance + Dimensionless (gain) * (err - variance); // variance of rtt } else { // First sample @@ -223,13 +223,13 @@ // If not enough samples, justjust return 2 times estimate //if (nSamples < 2) return est * 2; Time retval; - if (variance < est / Scalar (4.0)) + if (variance < est / Dimensionless (4.0)) { - retval = est * Scalar (2 * multiplier); // At least twice current est + retval = est * Dimensionless (2 * multiplier); // At least twice current est } else { - retval = (est + Scalar (4) * variance) * Scalar (multiplier); // As suggested by Jacobson + retval = (est + Dimensionless (4) * variance) * Dimensionless (multiplier); // As suggested by Jacobson } retval = Max (retval, minrto); return retval; diff -r a3afed368709 src/internet-stack/tcp-socket-impl.cc --- a/src/internet-stack/tcp-socket-impl.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/internet-stack/tcp-socket-impl.cc Wed Jul 07 19:23:30 2010 -0400 @@ -1650,7 +1650,7 @@ void TcpSocketImpl::PersistTimeout () { NS_LOG_LOGIC ("PersistTimeout expired at "< dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (receiver)); RoutingTableEntry newEntry (/*device=*/dev, /*dst=*/origin, /*validSeno=*/true, /*seqNo=*/rreqHeader.GetOriginSeqno (), /*iface=*/m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0), /*hops=*/hop, - /*nextHop*/src, /*timeLife=*/Scalar (2) * NetTraversalTime - Scalar (2 * hop) * NodeTraversalTime); + /*nextHop*/src, /*timeLife=*/Dimensionless (2) * NetTraversalTime - Dimensionless (2 * hop) * NodeTraversalTime); m_routingTable.AddRoute (newEntry); } else @@ -929,7 +929,7 @@ toOrigin.SetOutputDevice (m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (receiver))); toOrigin.SetInterface (m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0)); toOrigin.SetHop (hop); - toOrigin.SetLifeTime (std::max (Scalar (2) * NetTraversalTime - Scalar (2 * hop) * NodeTraversalTime, toOrigin.GetLifeTime ())); + toOrigin.SetLifeTime (std::max (Dimensionless (2) * NetTraversalTime - Dimensionless (2 * hop) * NodeTraversalTime, toOrigin.GetLifeTime ())); m_routingTable.Update (toOrigin); } NS_LOG_LOGIC (receiver << " receive RREQ to destination " << rreqHeader.GetDst ()); @@ -985,7 +985,7 @@ if (EnableHello) { m_htimer.Cancel (); - m_htimer.Schedule (HelloInterval - Scalar(0.1)*MilliSeconds(UniformVariable().GetInteger (0, 10))); + m_htimer.Schedule (HelloInterval - Dimensionless(0.1)*MilliSeconds(UniformVariable().GetInteger (0, 10))); } } @@ -1232,7 +1232,7 @@ } else { - toNeighbor.SetLifeTime (std::max (Scalar (AllowedHelloLoss) * HelloInterval, toNeighbor.GetLifeTime ())); + toNeighbor.SetLifeTime (std::max (Dimensionless (AllowedHelloLoss) * HelloInterval, toNeighbor.GetLifeTime ())); toNeighbor.SetSeqNo (rrepHeader.GetDstSeqno ()); toNeighbor.SetValidSeqNo (true); toNeighbor.SetFlag (VALID); @@ -1242,7 +1242,7 @@ } if (EnableHello) { - m_nb.Update (rrepHeader.GetDst (), Scalar (AllowedHelloLoss) * HelloInterval); + m_nb.Update (rrepHeader.GetDst (), Dimensionless (AllowedHelloLoss) * HelloInterval); } } @@ -1352,7 +1352,7 @@ NS_LOG_FUNCTION (this); SendHello (); m_htimer.Cancel (); - Time t = Scalar(0.01)*MilliSeconds(UniformVariable().GetInteger (0, 100)); + Time t = Dimensionless(0.01)*MilliSeconds(UniformVariable().GetInteger (0, 100)); m_htimer.Schedule (HelloInterval - t); } @@ -1386,7 +1386,7 @@ Ptr socket = j->first; Ipv4InterfaceAddress iface = j->second; RrepHeader helloHeader (/*prefix size=*/0, /*hops=*/0, /*dst=*/iface.GetLocal (), /*dst seqno=*/m_seqNo, - /*origin=*/iface.GetLocal (),/*lifetime=*/Scalar (AllowedHelloLoss) * HelloInterval); + /*origin=*/iface.GetLocal (),/*lifetime=*/Dimensionless (AllowedHelloLoss) * HelloInterval); Ptr packet = Create (); packet->AddHeader (helloHeader); TypeHeader tHeader (AODVTYPE_RREP); diff -r a3afed368709 src/routing/aodv/test/aodv-regression.cc --- a/src/routing/aodv/test/aodv-regression.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/routing/aodv/test/aodv-regression.cc Wed Jul 07 19:23:30 2010 -0400 @@ -101,7 +101,7 @@ // At m_time / 3 move central node away and see what will happen Ptr node = m_nodes->Get (m_size / 2); Ptr mob = node->GetObject (); - Simulator::Schedule (m_time / Scalar(3.0), &MobilityModel::SetPosition, mob, Vector (1e5, 1e5, 1e5)); + Simulator::Schedule (m_time / Dimensionless(3.0), &MobilityModel::SetPosition, mob, Vector (1e5, 1e5, 1e5)); Simulator::Stop (m_time); Simulator::Run (); diff -r a3afed368709 src/routing/olsr/olsr-routing-protocol.cc --- a/src/routing/olsr/olsr-routing-protocol.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/routing/olsr/olsr-routing-protocol.cc Wed Jul 07 19:23:30 2010 -0400 @@ -73,15 +73,15 @@ /********** Holding times **********/ /// Neighbor holding time. -#define OLSR_NEIGHB_HOLD_TIME (Scalar (3) * OLSR_REFRESH_INTERVAL) +#define OLSR_NEIGHB_HOLD_TIME (Dimensionless (3) * OLSR_REFRESH_INTERVAL) /// Top holding time. -#define OLSR_TOP_HOLD_TIME (Scalar (3) * m_tcInterval) +#define OLSR_TOP_HOLD_TIME (Dimensionless (3) * m_tcInterval) /// Dup holding time. #define OLSR_DUP_HOLD_TIME Seconds (30) /// MID holding time. -#define OLSR_MID_HOLD_TIME (Scalar (3) * m_midInterval) +#define OLSR_MID_HOLD_TIME (Dimensionless (3) * m_midInterval) /// HNA holding time. -#define OLSR_HNA_HOLD_TIME (Scalar (3) * m_hnaInterval) +#define OLSR_HNA_HOLD_TIME (Dimensionless (3) * m_hnaInterval) /********** Link types **********/ diff -r a3afed368709 src/simulator/nstime.h --- a/src/simulator/nstime.h Wed Jul 07 23:58:40 2010 +0900 +++ b/src/simulator/nstime.h Wed Jul 07 19:23:30 2010 -0400 @@ -80,7 +80,7 @@ * multiply multiple TimeUnit objects. The return type of any such * arithmetic expression is always a TimeUnit object. * - * The ns3::Scalar, ns3::Time, ns3::TimeSquare, and ns3::TimeInvert classes + * The ns3::Dimensionless, ns3::Time, ns3::TimeSquare, and ns3::TimeInvert classes * are aliases for the TimeUnit<0>, TimeUnit<1>, TimeUnit<2> and TimeUnit<-1> * types respectively. * @@ -93,7 +93,7 @@ * Time<3> t5 = t3 * t1; * Time<-2> t6 = t1 / t5; * TimeSquare t7 = t3; - * Scalar s = t4; + * Dimensionless s = t4; * \endcode * * If you try to assign the result of an expression which does not @@ -489,7 +489,7 @@ * the standard C++ operators (if you make sure to obey the rules * of the ns3::TimeUnit class template) * To scale a Time instance, you can multiply it with an instance of - * the ns3::Scalar class. + * the ns3::Dimensionless class. * Time instances can also be manipulated through the following non-member * functions: * - \ref ns3-Time-Abs ns3::Abs @@ -620,7 +620,7 @@ // -*- New methods -*- public: double GetDouble (void) const; - TimeUnit<0> (double scalar); + TimeUnit<0> (double dimensionless); // -*- The rest is the the same as in the generic template class -*- public: @@ -675,33 +675,34 @@ }; /** - * \brief hold scalar values + * \brief hold dimensionless values * - * This class is used both to construct scalar values to multiply - * ns3::Time instances and to hold the return value of - * an expression which returns a scalar. For example, the + * This class is used both to construct dimensionless + * values to multiply ns3::Time instances and to + * hold the return value of an expression which returns + * a dimensionless value. For example, the * following code will output on your terminal 1.5: * \code - * Scalar s0 = Scalar (1.5); + * Dimensionless s0 = Dimensionless (1.5); * Time t1 = Seconds (10.0) * s0; - * Time t2 = Seconds (10.0) * Scalar (2.5); - * Scalar s1 = Seconds (15.0) / Seconds (10.0); + * Time t2 = Seconds (10.0) * Dimensionless (2.5); + * Dimensionless s1 = Seconds (15.0) / Seconds (10.0); * std::cout << s1.GetDouble () << std::endl; * \endcode * - * The Scalar class has the following additional methods not available in + * The Dimensionless class has the following additional methods not available in * the generic TimeUnit template: * \code * double GetDouble (void) const; * \endcode - * returns the C double contained in the Scalar instance + * returns the C double contained in the Dimensionless instance * * \code - * Scalar(double scalar); + * Dimensionless(double dimensionless); * \endcode - * Constructs a Scalar instance from a C double. + * Constructs a Dimensionless instance from a C double. */ -typedef TimeUnit<0> Scalar; +typedef TimeUnit<0> Dimensionless; typedef TimeUnit<-1> TimeInvert; typedef TimeUnit<2> TimeSquare; diff -r a3afed368709 src/simulator/time.cc --- a/src/simulator/time.cc Wed Jul 07 23:58:40 2010 +0900 +++ b/src/simulator/time.cc Wed Jul 07 19:23:30 2010 -0400 @@ -350,8 +350,8 @@ return Time (HighPrecision (ts, false)); } -TimeUnit<0>::TimeUnit (double scalar) - : m_data (HighPrecision (scalar)) +TimeUnit<0>::TimeUnit (double dimensionless) + : m_data (HighPrecision (dimensionless)) { } @@ -433,16 +433,16 @@ NS_TEST_ASSERT_MSG_EQ ((MilliSeconds (0) > NanoSeconds (0)), false, "Zero is bigger than Zero ?"); NS_TEST_ASSERT_MSG_EQ ((MilliSeconds (0) < NanoSeconds (0)), false, "Zero is smaller than Zero ?"); - Time t4 = Seconds (10.0) * Scalar (1.5); + Time t4 = Seconds (10.0) * Dimensionless (1.5); ASSERT_EQ (t4.GetSeconds (), 15.0); - Time t5 = NanoSeconds (10) * Scalar (1.5); + Time t5 = NanoSeconds (10) * Dimensionless (1.5); ASSERT_EQ (t5.GetNanoSeconds (), 15.0); - Time t6 = Seconds (10.0) * Scalar (15) / Scalar (10); + Time t6 = Seconds (10.0) * Dimensionless (15) / Dimensionless (10); ASSERT_EQ (t6.GetSeconds (), 15.0); - Time t7 = NanoSeconds (10) * Scalar (15) / Scalar (10); + Time t7 = NanoSeconds (10) * Dimensionless (15) / Dimensionless (10); ASSERT_EQ (t7.GetNanoSeconds (), 15.0); ASSERT_EQ ((t1 + t2).GetSeconds (), t1.GetSeconds () + t2.GetSeconds ()); @@ -492,8 +492,8 @@ (t0.GetSeconds () / t1.GetSeconds () * (t0.GetSeconds () - t1.GetSeconds ()))); ASSERT_EQ (((t0 / t1) * (t0 - t1)).GetSeconds (), (t0.GetSeconds () / t1.GetSeconds ()) * (t0.GetSeconds () - t1.GetSeconds ())); - ASSERT_EQ ((t0 * Scalar (10.0)).GetSeconds (), (t0.GetSeconds () * 10.0)); - ASSERT_EQ ((Scalar (10.0) * t0).GetSeconds (), (10.0 * t0.GetSeconds ())); + ASSERT_EQ ((t0 * Dimensionless (10.0)).GetSeconds (), (t0.GetSeconds () * 10.0)); + ASSERT_EQ ((Dimensionless (10.0) * t0).GetSeconds (), (10.0 * t0.GetSeconds ())); // Note: we need to multiply by 1e9 because GetSeconds is multiplying ASSERT_EQ (((t0 / (t1 * (t0 - t1))).GetHighPrecision ().GetDouble () * 1e9), @@ -704,8 +704,8 @@ bool Bug863TestCase::DoRun (void) { - Scalar result = Scalar (0.9) / Scalar (1.0); - NS_TEST_ASSERT_MSG_EQ ((result == Scalar (0.9)), true, "Invalid arithmetic result"); + Dimensionless result = Dimensionless (0.9) / Dimensionless (1.0); + NS_TEST_ASSERT_MSG_EQ ((result == Dimensionless (0.9)), true, "Invalid arithmetic result"); return false; } diff -r a3afed368709 utils/python-unit-tests.py --- a/utils/python-unit-tests.py Wed Jul 07 23:58:40 2010 +0900 +++ b/utils/python-unit-tests.py Wed Jul 07 19:23:30 2010 -0400 @@ -53,7 +53,7 @@ self.assertEqual(ns3.Seconds(10) + ns3.Seconds(5), ns3.Seconds(15)) self.assertEqual(ns3.Seconds(10) - ns3.Seconds(5), ns3.Seconds(5)) - v1 = ns3.Scalar(5)*ns3.Seconds(10) + v1 = ns3.Dimensionless(5)*ns3.Seconds(10) self.assertEqual(v1, ns3.Seconds(50)) def testConfig(self):