30 #include "ns3/core-module.h"
31 #include "ns3/stats-module.h"
44 static TypeId GetTypeId (
void);
47 void DoInitialize (
void);
64 .AddTraceSource (
"Counter",
75 m_var = CreateObject<ExponentialRandomVariable> ();
103 int main (
int argc,
char *argv[])
106 cmd.
Parse (argc, argv);
140 fileHelper.
Set2dFormat (
"Time (Seconds) = %.3e\tCount = %.0f");
145 "/Names/Probe/Output",
#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 the class in the ns-3 factory.
static void Run(void)
Run the simulation until one of:
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
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)
static void Add(std::string name, Ptr< Object > object)
Add the association between the string "name" and the Ptr
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
int main(int argc, char *argv[])
Helper class used to put data values into a file.
Parse command-line arguments.
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
void DoInitialize(void)
This method is called only once by Object::Initialize.
TracedValue< double > m_counter
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
void ConfigureFile(const std::string &outputFileNameWithoutExtension, enum FileAggregator::FileType fileType=FileAggregator::SPACE_SEPARATED)
static Time Now(void)
Return the "current simulation time".
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
void SetName(std::string name)
Set the object's name. All spaces are replaced by underscores.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void Initialize(void)
This method calls the virtual DoInitialize method on all the objects aggregated to this object...
void WriteProbe(const std::string &typeId, const std::string &path, const std::string &probeTraceSource)
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.
void Set2dFormat(const std::string &format)
Sets the 2D format string for the C-style sprintf() function.