Index: src/stats/examples/time-probe-example.cc |
=================================================================== |
--- a/src/stats/examples/time-probe-example.cc |
+++ b/src/stats/examples/time-probe-example.cc |
@@ -18,7 +18,7 @@ |
// |
// This example is designed to show the main features of an ns3::TimeProbe. |
-// A test object is used to emit values through a trace source. The |
+// A test object is used to emit values through a trace source. The |
// example shows three ways to use a ns3::TimeProbe to hook the output |
// of this trace source (in addition to hooking the raw trace source). |
// |
@@ -47,7 +47,7 @@ |
// |
// This is our test object, an object that emits values according to |
-// a Poisson arrival process. It emits a traced Time value as a |
+// a Poisson arrival process. It emits a traced Time value as a |
// trace source; this takes the value of interarrival time |
// |
class Emitter : public Object |
@@ -64,8 +64,8 @@ |
// void Emit (void); |
void Emit (void); |
- TracedValue<Time> m_interval; |
- Time m_last; |
+ TracedValue<Time> m_interval; |
+ Time m_last; |
Ptr<ExponentialRandomVariable> m_var; |
}; |
@@ -123,13 +123,13 @@ |
// This is a function to test hooking it to the probe output |
void |
-NotifyViaProbe (std::string context, double oldVal, double newVal) |
+NotifyViaProbe (std::string context, Time oldVal, Time newVal) |
{ |
BooleanValue verbose; |
GlobalValue::GetValueByName ("verbose", verbose); |
if (verbose.Get ()) |
{ |
- std::cout << "context: " << context << " old " << oldVal << " new " << newVal << std::endl; |
+ std::cout << "context: " << context << " old " << oldVal.GetSeconds () << " new " << newVal.GetSeconds () << std::endl; |
} |
} |
@@ -235,11 +235,10 @@ |
// Helper creates a TimeProbe and hooks it to the /Names/Emitter/Interval |
// source. Helper also takes the Output of the TimeProbe and plots it |
// as a dataset labeled 'Emitter Interarrival Time' |
- plotHelper.PlotProbe ("ns3::TimeProbe", |
- "/Names/Emitter/Interval", |
- "Output", |
- "Emitter Interarrival Time", |
- GnuplotAggregator::KEY_INSIDE); |
+ plotHelper.AddProbe ("ns3::TimeProbe", |
+ "/Names/Emitter/Interval", |
+ "Output", |
+ "Emitter Interarrival Time"); |
// The Emitter object is not associated with an ns-3 node, so |
// it won't get started automatically, so we need to do this ourselves |