View | Details | Raw Unified | Return to bug 1675
Collapse All | Expand All

(-)a/examples/wireless/multirate.cc (-3 / +16 lines)
 Lines 103-108    Link Here 
103
103
104
  double totalTime; 
104
  double totalTime; 
105
  double expMean;
105
  double expMean;
106
  double samplingPeriod;
106
107
107
  uint32_t bytesTotal;
108
  uint32_t bytesTotal;
108
  uint32_t packetSize;
109
  uint32_t packetSize;
 Lines 129-134    Link Here 
129
  m_output (name),
130
  m_output (name),
130
  totalTime (0.3),
131
  totalTime (0.3),
131
  expMean (0.1), //flows being exponentially distributed
132
  expMean (0.1), //flows being exponentially distributed
133
  samplingPeriod(0.1),
132
  bytesTotal (0),
134
  bytesTotal (0),
133
  packetSize (2000),
135
  packetSize (2000),
134
  gridSize (10), //10x10 grid  for a total of 100 nodes
136
  gridSize (10), //10x10 grid  for a total of 100 nodes
 Lines 172-183    Link Here 
172
void
174
void
173
Experiment::CheckThroughput ()
175
Experiment::CheckThroughput ()
174
{
176
{
175
  double mbs = ((bytesTotal * 8.0) /1000000);
177
  double mbs = ((bytesTotal * 8.0) /1000000 /samplingPeriod);
176
  bytesTotal = 0;
178
  bytesTotal = 0;
177
  m_output.Add ((Simulator::Now ()).GetSeconds (), mbs);
179
  m_output.Add ((Simulator::Now ()).GetSeconds (), mbs);
178
180
179
  //check throughput every 1/10 of a second 
181
  //check throughput every samplingPeriod second
180
  Simulator::Schedule (Seconds (0.1), &Experiment::CheckThroughput, this);
182
  Simulator::Schedule (Seconds (samplingPeriod), &Experiment::CheckThroughput, this);
181
}
183
}
182
184
183
/**
185
/**
 Lines 534-539    Link Here 
534
  CommandLine cmd;
536
  CommandLine cmd;
535
  cmd.AddValue ("packetSize", "packet size", packetSize);
537
  cmd.AddValue ("packetSize", "packet size", packetSize);
536
  cmd.AddValue ("totalTime", "simulation time", totalTime);
538
  cmd.AddValue ("totalTime", "simulation time", totalTime);
539
  // according to totalTime, select an appropriate samplingPeriod automaticlly.
540
  if (totalTime < 1.0)
541
    {
542
	  samplingPeriod = 0.1;
543
    }
544
  else
545
    {
546
	  samplingPeriod = 1.0;
547
    }
548
  // or user selects a samplingPeriod.
549
  cmd.AddValue ("samplingPeriod", "sampling period", samplingPeriod);
537
  cmd.AddValue ("rtsThreshold", "rts threshold", rtsThreshold);
550
  cmd.AddValue ("rtsThreshold", "rts threshold", rtsThreshold);
538
  cmd.AddValue ("rateManager", "type of rate", rateManager);
551
  cmd.AddValue ("rateManager", "type of rate", rateManager);
539
  cmd.AddValue ("outputFileName", "output filename", outputFileName);
552
  cmd.AddValue ("outputFileName", "output filename", outputFileName);
(-)a/examples/wireless/wifi-hidden-terminal.cc (-1 / +1 lines)
 Lines 158-164    Link Here 
158
          Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (i->first);
158
          Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (i->first);
159
          std::cout << "Flow " << i->first - 2 << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n";           std::cout << "  Tx Bytes:   " << i->second.txBytes << "\n";
159
          std::cout << "Flow " << i->first - 2 << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n";           std::cout << "  Tx Bytes:   " << i->second.txBytes << "\n";
160
          std::cout << "  Rx Bytes:   " << i->second.rxBytes << "\n";
160
          std::cout << "  Rx Bytes:   " << i->second.rxBytes << "\n";
161
          std::cout << "  Throughput: " << i->second.rxBytes * 8.0 / 10.0 / 1024 / 1024  << " Mbps\n";
161
          std::cout << "  Throughput: " << i->second.rxBytes * 8.0 / 10.0 / 1000 / 1000  << " Mbps\n";
162
        }
162
        }
163
    }
163
    }
164
164

Return to bug 1675