22 #include "ns3/simulator.h"
23 #include "ns3/simple-device-energy-model.h"
24 #include "ns3/li-ion-energy-source.h"
25 #include "ns3/energy-source-container.h"
61 main (
int argc,
char **argv)
73 sem->SetEnergySource (es);
74 es->AppendDeviceEnergyModel (sem);
81 sem->SetCurrentA (2.33);
100 es->GetAttribute (
"ThresholdVoltage", v);
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
#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.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
virtual double GetRemainingEnergy(void)
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
void SetCurrentA(double current)
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
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.
virtual double GetSupplyVoltage(void) const
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'...