diff -r 87623f49bd1e src/devices/point-to-point/point-to-point-channel.cc --- a/src/devices/point-to-point/point-to-point-channel.cc Mon Feb 02 10:57:21 2009 +0000 +++ b/src/devices/point-to-point/point-to-point-channel.cc Mon Feb 02 15:08:15 2009 +0000 @@ -34,10 +34,10 @@ static TypeId tid = TypeId ("ns3::PointToPointChannel") .SetParent () .AddConstructor () - .AddAttribute ("Delay", "Transmission delay through the channel", - TimeValue (Seconds (0)), - MakeTimeAccessor (&PointToPointChannel::m_delay), - MakeTimeChecker ()) + .AddAttribute ("Delay", "Random variable giving transmission delay through the channel, in seconds.", + RandomVariableValue (ConstantVariable (0)), + MakeRandomVariableAccessor (&PointToPointChannel::m_delay), + MakeRandomVariableChecker ()) ; return tid; } @@ -48,7 +48,6 @@ PointToPointChannel::PointToPointChannel() : Channel ("PointToPoint Channel"), - m_delay (Seconds (0.)), m_nDevices (0) { NS_LOG_FUNCTION_NOARGS (); @@ -89,7 +88,7 @@ uint32_t wire = src == m_link[0].m_src ? 0 : 1; - Simulator::Schedule (txTime + m_delay, &PointToPointNetDevice::Receive, + Simulator::Schedule (txTime + Seconds (m_delay.GetValue ()), &PointToPointNetDevice::Receive, m_link[wire].m_dst, p); return true; } diff -r 87623f49bd1e src/devices/point-to-point/point-to-point-channel.h --- a/src/devices/point-to-point/point-to-point-channel.h Mon Feb 02 10:57:21 2009 +0000 +++ b/src/devices/point-to-point/point-to-point-channel.h Mon Feb 02 15:08:15 2009 +0000 @@ -24,6 +24,7 @@ #include "ns3/ptr.h" #include "ns3/nstime.h" #include "ns3/data-rate.h" +#include "ns3/random-variable.h" namespace ns3 { @@ -94,8 +95,8 @@ // Each point to point link has exactly two net devices static const int N_DEVICES = 2; - Time m_delay; - int32_t m_nDevices; + RandomVariable m_delay; + int32_t m_nDevices; enum WireState {