20 #include "ns3/command-line.h"
21 #include "ns3/energy-source-container.h"
22 #include "ns3/li-ion-energy-source.h"
24 #include "ns3/simple-device-energy-model.h"
25 #include "ns3/simulator.h"
51 <<
" Cell voltage: " << es->GetSupplyVoltage()
52 <<
" V Remaining Capacity: " << es->GetRemainingEnergy() / (3.6 * 3600) <<
" Ah"
62 main(
int argc,
char** argv)
65 cmd.Parse(argc, argv);
78 es->AppendDeviceEnergyModel(sem);
100 es->GetAttribute(
"ThresholdVoltage", v);
Parse command-line arguments.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Smart pointer class similar to boost::intrusive_ptr.
void SetCurrentA(double current)
virtual void SetNode(Ptr< Node > node)
Sets pointer to node.
void SetEnergySource(Ptr< EnergySource > source) override
Sets pointer to EnergySource installed on node.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static bool IsFinished()
Check if the simulation should finish.
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Time Seconds(double value)
Construct a Time in the indicated unit.
static void PrintCellInfo(Ptr< LiIonEnergySource > es)
In this simple example, we show how to create and drain energy from a LiIonEnergySource.
Every class exported by the ns3 library is enclosed in the ns3 namespace.