A Discrete-Event Network Simulator
API
generic-battery-discharge-example.cc File Reference
#include <ns3/core-module.h>
#include <ns3/energy-module.h>
#include <ns3/gnuplot.h>
#include <fstream>
#include <sstream>
#include <string>
+ Include dependency graph for generic-battery-discharge-example.cc:

Go to the source code of this file.

Functions

std::ofstream battDischFile1 ("BattDischCurve1.plt")
 
std::ofstream battDischFile2 ("BattDischCurve2.plt")
 
std::ofstream battDischFile3 ("BattDischCurve3.plt")
 
std::ofstream battDischFile4 ("BattDischCurve4.plt")
 
std::ofstream battDischFile5 ("BattDischCurve5.plt")
 
void GraphBattery1 (Ptr< GenericBatteryModel > es)
 
void GraphBattery2 (Ptr< GenericBatteryModel > es)
 
void GraphBattery3 (Ptr< GenericBatteryModel > es)
 
void GraphBattery4 (Ptr< GenericBatteryModel > es)
 
void GraphBattery5 (Ptr< GenericBatteryModel > es)
 

Variables

Gnuplot2dDataset battDischDataset1
 
Gnuplot2dDataset battDischDataset2
 
Gnuplot2dDataset battDischDataset3
 
Gnuplot2dDataset battDischDataset4
 
Gnuplot2dDataset battDischDataset5
 
Gnuplot battDischPlot1 = Gnuplot("BattDisch1.eps")
 This example shows the use of batteries in ns-3. More...
 
Gnuplot battDischPlot2 = Gnuplot("BattDisch2.eps")
 
Gnuplot battDischPlot3 = Gnuplot("BattDisch3.eps")
 
Gnuplot battDischPlot4 = Gnuplot("BattDisch4.eps")
 
Gnuplot battDischPlot5 = Gnuplot("BattDisch5.eps")
 

Function Documentation

◆ battDischFile1()

std::ofstream battDischFile1 ( "BattDischCurve1.plt"  )

◆ battDischFile2()

std::ofstream battDischFile2 ( "BattDischCurve2.plt"  )

◆ battDischFile3()

std::ofstream battDischFile3 ( "BattDischCurve3.plt"  )

◆ battDischFile4()

std::ofstream battDischFile4 ( "BattDischCurve4.plt"  )

◆ battDischFile5()

std::ofstream battDischFile5 ( "BattDischCurve5.plt"  )

◆ GraphBattery1()

◆ GraphBattery2()

◆ GraphBattery3()

void GraphBattery3 ( Ptr< GenericBatteryModel es)

◆ GraphBattery4()

◆ GraphBattery5()

Variable Documentation

◆ battDischDataset1

Gnuplot2dDataset battDischDataset1

Definition at line 52 of file generic-battery-discharge-example.cc.

Referenced by GraphBattery1().

◆ battDischDataset2

Gnuplot2dDataset battDischDataset2

Definition at line 56 of file generic-battery-discharge-example.cc.

Referenced by GraphBattery2().

◆ battDischDataset3

Gnuplot2dDataset battDischDataset3

Definition at line 60 of file generic-battery-discharge-example.cc.

Referenced by GraphBattery3().

◆ battDischDataset4

Gnuplot2dDataset battDischDataset4

Definition at line 64 of file generic-battery-discharge-example.cc.

Referenced by GraphBattery4().

◆ battDischDataset5

Gnuplot2dDataset battDischDataset5

Definition at line 68 of file generic-battery-discharge-example.cc.

Referenced by GraphBattery5().

◆ battDischPlot1

Gnuplot battDischPlot1 = Gnuplot("BattDisch1.eps")

This example shows the use of batteries in ns-3.

5 batteries of different chemistries are discharged using a constant current. Batteries can be configured manually using the necessary parameters or using presets.

In this example, only the first battery uses parameters to form a NiMh battery. The rest of the batteries in this example use defined presets with already tested parameters.

Users can make their own battery presets by setting the necessary parameters as in the example in the first battery.

Plot files are produced as a result of this example. Graphs can be obtained from the plot using:

$> gnuplot <plotname>.plt

Definition at line 51 of file generic-battery-discharge-example.cc.

◆ battDischPlot2

Gnuplot battDischPlot2 = Gnuplot("BattDisch2.eps")

Definition at line 55 of file generic-battery-discharge-example.cc.

◆ battDischPlot3

Gnuplot battDischPlot3 = Gnuplot("BattDisch3.eps")

Definition at line 59 of file generic-battery-discharge-example.cc.

◆ battDischPlot4

Gnuplot battDischPlot4 = Gnuplot("BattDisch4.eps")

Definition at line 63 of file generic-battery-discharge-example.cc.

◆ battDischPlot5

Gnuplot battDischPlot5 = Gnuplot("BattDisch5.eps")

Definition at line 67 of file generic-battery-discharge-example.cc.