87 #include "ns3/simulator.h" 
   88 #include "ns3/nstime.h" 
   89 #include "ns3/command-line.h" 
   91 #include "ns3/random-variable-stream.h" 
  115   std::cout << 
"Replacing time printer function after Simulator::Run ()" << std::endl;
 
  123 int main (
int argc, 
char *argv[])
 
  125   bool replaceTimePrinter = 
false;
 
  126   std::string resolution = 
"Time::NS";
 
  133   cmd.
AddValue (
"replaceTimePrinter", 
"replace time printing function", replaceTimePrinter);
 
  134   cmd.
AddValue (
"resolution", 
"time resolution", resolution);
 
  135   cmd.
Parse (argc, argv);
 
  137   auto search = resolutionMap.find (resolution);
 
  138   if (search != resolutionMap.end ())
 
  145   if (replaceTimePrinter)
 
void SetAntithetic(bool isAntithetic)
Specify whether antithetic values should be generated. 
 
static void Run(void)
Run the simulation. 
 
double GetSeconds(void) const 
Get an approximation of the time stored in this instance in the indicated unit. 
 
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component. 
 
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay. 
 
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit. 
 
Parse command-line arguments. 
 
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy(). 
 
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components. 
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
Prefix all trace prints with simulation time. 
 
static Time Now(void)
Return the current simulation virtual time. 
 
void LogSetTimePrinter(LogTimePrinter printer)
Set the LogTimePrinter function to be used to prepend log messages with the simulation time...
 
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD. 
 
Time Seconds(double value)
Construct a Time in the indicated unit. 
 
static void SetResolution(enum Unit resolution)
 
void Parse(int argc, char *argv[])
Parse the program arguments.