examples/simple-point-to-point-olsr.cc
changeset 2965 4b28e9740e3b
parent 2890 172baa5960ff
child 2974 30ed185e0364
--- a/examples/simple-point-to-point-olsr.cc	Mon Apr 14 16:19:17 2008 -0700
+++ b/examples/simple-point-to-point-olsr.cc	Thu Apr 17 13:42:25 2008 -0700
@@ -67,8 +67,8 @@
 
   // Set up some default values for the simulation.  Use the 
 
-  Config::SetDefault ("ns3::OnOffApplication::PacketSize", Uinteger (210));
-  Config::SetDefault ("ns3::OnOffApplication::DataRate", DataRate ("448kb/s"));
+  Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
+  Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s"));
 
   //DefaultValue::Bind ("DropTailQueue::m_maxPackets", 30);   
 
@@ -93,12 +93,12 @@
   // We create the channels first without any IP addressing information
   NS_LOG_INFO ("Create channels.");
   PointToPointHelper p2p;
-  p2p.SetChannelParameter ("BitRate", DataRate (5000000));
-  p2p.SetChannelParameter ("Delay", MilliSeconds (2));
+  p2p.SetChannelParameter ("BitRate", StringValue ("5Mbps"));
+  p2p.SetChannelParameter ("Delay", StringValue ("2ms"));
   NetDeviceContainer nd02 = p2p.Install (n02);
   NetDeviceContainer nd12 = p2p.Install (n12);
-  p2p.SetChannelParameter ("BitRate", DataRate (1500000));
-  p2p.SetChannelParameter ("Delay", MilliSeconds (10));
+  p2p.SetChannelParameter ("BitRate", StringValue ("1500Kbps"));
+  p2p.SetChannelParameter ("Delay", StringValue ("10ms"));
   NetDeviceContainer nd32 = p2p.Install (n32);
   NetDeviceContainer nd34 = p2p.Install (n34);
   
@@ -128,9 +128,9 @@
   uint16_t port = 9;   // Discard port (RFC 863)
 
   OnOffHelper onoff ("ns3::Udp", 
-    Address (InetSocketAddress (i34.GetAddress (1), port)));
-  onoff.SetAttribute ("OnTime", ConstantVariable (1));
-  onoff.SetAttribute ("OffTime", ConstantVariable (0));
+                     InetSocketAddress (i34.GetAddress (1), port));
+  onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
+  onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
 
   ApplicationContainer apps = onoff.Install (c.Get (0));
   apps.Start (Seconds (1.0));
@@ -138,7 +138,7 @@
 
   // Create a packet sink to receive these packets
   PacketSinkHelper sink ("ns3::Udp",
-    Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
+                         InetSocketAddress (Ipv4Address::GetAny (), port));
 
   apps = sink.Install (c.Get (3));
   apps.Start (Seconds (1.0));
@@ -146,7 +146,7 @@
 
   // Create a similar flow from n3 to n1, starting at time 1.1 seconds
   onoff.SetAttribute ("Remote",
-    Address (InetSocketAddress (i12.GetAddress (0), port)));
+                      AddressValue (InetSocketAddress (i12.GetAddress (0), port)));
   apps = onoff.Install (c.Get (3));
   apps.Start (Seconds (1.1));
   apps.Stop (Seconds (10.0));