src/spectrum/examples/adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc
changeset 8966 060dba23e9bb
parent 7554 e536a09d83ee
child 9000 3ec20a64fd08
equal deleted inserted replaced
8965:cfed4f87e003 8966:060dba23e9bb
   189   socket.SetSingleDevice (devices.Get (0)->GetIfIndex ());
   189   socket.SetSingleDevice (devices.Get (0)->GetIfIndex ());
   190   socket.SetPhysicalAddress (devices.Get (1)->GetAddress ());
   190   socket.SetPhysicalAddress (devices.Get (1)->GetAddress ());
   191   socket.SetProtocol (1);
   191   socket.SetProtocol (1);
   192 
   192 
   193   OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
   193   OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
   194   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (250)));
   194   onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=250]"));
   195   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
   195   onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
   196   onoff.SetAttribute ("DataRate", DataRateValue (DataRate (2*phyRate)));
   196   onoff.SetAttribute ("DataRate", DataRateValue (DataRate (2*phyRate)));
   197   onoff.SetAttribute ("PacketSize", UintegerValue (pktSize));
   197   onoff.SetAttribute ("PacketSize", UintegerValue (pktSize));
   198 
   198 
   199   ApplicationContainer apps = onoff.Install (c.Get (0));
   199   ApplicationContainer apps = onoff.Install (c.Get (0));
   200   apps.Start (Seconds (0.0));
   200   apps.Start (Seconds (0.0));