30 #include "ns3/core-module.h"
31 #include "ns3/stats-module.h"
45 static TypeId GetTypeId (
void);
48 void DoInitialize (
void);
63 .AddTraceSource (
"Counter",
66 "ns3::TracedValue::DoubleCallback")
75 m_var = CreateObject<ExponentialRandomVariable> ();
94 int main (
int argc,
char *argv[])
97 cmd.
Parse (argc, argv);
118 "Emitter Count vs. Time",
126 plotHelper.
PlotProbe (
"ns3::Uinteger32Probe",
127 "/Names/Emitter/Counter",
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
TypeId AddConstructor(void)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void PlotProbe(const std::string &typeId, const std::string &path, const std::string &probeTraceSource, const std::string &title, enum GnuplotAggregator::KeyLocation keyLocation=GnuplotAggregator::KEY_INSIDE)
static void Run(void)
Run the simulation.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
TracedValue< double > m_counter
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
static TypeId GetTypeId(void)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
static void Add(std::string name, Ptr< Object > object)
Add the association between the string "name" and the Ptr
void ConfigurePlot(const std::string &outputFileNameWithoutExtension, const std::string &title, const std::string &xLegend, const std::string &yLegend, const std::string &terminalType="png")
Parse command-line arguments.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
void DoInitialize(void)
Initialize() implementation.
Helper class used to make gnuplot plots.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static Time Now(void)
Return the current simulation virtual time.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
void Parse(int argc, char *argv[])
Parse the program arguments.
A base class which provides memory management and object aggregation.
a unique identifier for an interface.