johnabra-mac:ns-3-dev johnabraham$ hg diff
diff -r 23373993f110 src/netanim/examples/star-animation.cc
--- a/src/netanim/examples/star-animation.cc Mon Dec 10 10:54:28 2012 -0800
+++ b/src/netanim/examples/star-animation.cc Sun Jan 20 22:01:56 2013 -0800
@@ -49,7 +49,7 @@
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (137));
// ??? try and stick 15kb/s into the data rate
- Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("14kb/s"));
+ Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("1400kb/s"));
//
// Default number of nodes in the star. Overridable by command line argument.
@@ -69,7 +69,7 @@
NS_LOG_INFO ("Build star topology.");
PointToPointHelper pointToPoint;
- pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+ pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("3Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
PointToPointStarHelper star (nSpokes, pointToPoint);
@@ -110,13 +110,17 @@
// Create OnOff applications to send TCP to the hub, one on each spoke node.
//
- onOffHelper.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
- onOffHelper.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
+ std::ostringstream oss1;
+ oss1 << "ns3::ConstantRandomVariable[Constant=" << (i+1)%2 << "]";
+ std::ostringstream oss2;
+ oss2 << "ns3::ConstantRandomVariable[Constant=" << i << "]";
+ onOffHelper.SetAttribute ("OnTime", StringValue (oss1.str ()));
+ onOffHelper.SetAttribute ("OffTime", StringValue (oss2.str ()));
AddressValue remoteAddress;
if (useIpv6 == 0)
{