|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
Parse command-line arguments.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
void SetCurrentA(double current)
Smart pointer class similar to boost::intrusive_ptr.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
void SetNode(Ptr< Node > node)
Sets pointer to node containing this EnergySource.
Simulation virtual time values and global simulation resolution.
virtual void SetNode(Ptr< Node > node)
Sets pointer to node.
static void Run(void)
Run the simulation.
Time Seconds(double value)
Construct a Time in the indicated unit.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
virtual double GetSupplyVoltage(void) const
static bool IsFinished(void)
Check if the simulation should finish.
static void PrintCellInfo(Ptr< LiIonEnergySource > es)
In this simple example, we show how to create and drain energy from a LiIonEnergySource.
virtual void SetEnergySource(Ptr< EnergySource > source)
Sets pointer to EnergySouce installed on node.
void Add(EnergySourceContainer container)
virtual double GetRemainingEnergy(void)
void AppendDeviceEnergyModel(Ptr< DeviceEnergyModel > deviceEnergyModelPtr)