16#include "ns3/core-module.h"
17#include "ns3/stats-module.h"
56 .SetGroupName(
"Stats")
58 .AddTraceSource(
"Counter",
61 "ns3::TracedValueCallback::Double");
89main(
int argc,
char* argv[])
92 cmd.Parse(argc, argv);
113 "Emitter Count vs. Time",
121 plotHelper.
PlotProbe(
"ns3::Uinteger32Probe",
122 "/Names/Emitter/Counter",
This is our test object, an object that increments counters at various times and emits one of them as...
void DoInitialize() override
Initialize() implementation.
static TypeId GetTypeId()
Register this type.
TracedValue< double > m_counter
Sample counter, normally this would be integer type.
static TypeId GetTypeId()
Register this type.
void Count()
Counts how many time this function is called.
Ptr< ExponentialRandomVariable > m_var
Random number generator.
Parse command-line arguments.
Helper class used to make gnuplot plots.
void ConfigurePlot(const std::string &outputFileNameWithoutExtension, const std::string &title, const std::string &xLegend, const std::string &yLegend, const std::string &terminalType="png")
void PlotProbe(const std::string &typeId, const std::string &path, const std::string &probeTraceSource, const std::string &title, GnuplotAggregator::KeyLocation keyLocation=GnuplotAggregator::KEY_INSIDE)
static void Add(std::string name, Ptr< Object > object)
Add the association between the string "name" and the Ptr<Object> obj.
A base class which provides memory management and object aggregation.
void Initialize()
Invoke DoInitialize on all Objects aggregated to this one.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Trace classes with value semantics.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.