22 #include "ns3/simulator.h" 23 #include "ns3/command-line.h" 24 #include "ns3/simple-device-energy-model.h" 25 #include "ns3/li-ion-energy-source.h" 26 #include "ns3/energy-source-container.h" 62 main (
int argc,
char **argv)
65 cmd.Parse (argc, argv);
77 sem->SetEnergySource (es);
78 es->AppendDeviceEnergyModel (sem);
85 sem->SetCurrentA (2.33);
104 es->GetAttribute (
"ThresholdVoltage", v);
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
virtual double GetSupplyVoltage(void) const
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
static void Run(void)
Run the simulation.
virtual double GetRemainingEnergy(void)
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
void SetCurrentA(double current)
Parse command-line arguments.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
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 PrintCellInfo(Ptr< LiIonEnergySource > es)
In this simple example, we show how to create and drain energy from a LiIonEnergySource.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Time Seconds(double value)
Construct a Time in the indicated unit.
static bool IsFinished(void)
Check if the simulation should finish.
This class can be used to hold variables of floating point type such as 'double' or 'float'...