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 until one of:
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)
int main(int argc, char **argv)
void AggregateObject(Ptr< Object > other)
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
static Time Now(void)
Return the "current simulation 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)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
Time Seconds(double value)
Construct a Time in the indicated unit.
virtual double GetSupplyVoltage(void) const
static bool IsFinished(void)
If there are no more events lefts to be scheduled, or if simulation time has already reached the "sto...
Hold a floating point type.