#include <ns3/core-module.h>
#include <ns3/energy-module.h>
#include <ns3/gnuplot.h>
#include <fstream>
#include <sstream>
#include <string>
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. | |
Gnuplot | battDischPlot2 = Gnuplot("BattDisch2.eps") |
Gnuplot | battDischPlot3 = Gnuplot("BattDisch3.eps") |
Gnuplot | battDischPlot4 = Gnuplot("BattDisch4.eps") |
Gnuplot | battDischPlot5 = Gnuplot("BattDisch5.eps") |
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 | ) |
Definition at line 64 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset1, ns3::Time::GetMinutes(), GraphBattery1(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by GraphBattery1().
void GraphBattery2 | ( | Ptr< GenericBatteryModel > | es | ) |
Definition at line 79 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset2, ns3::Time::GetMinutes(), GraphBattery2(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by GraphBattery2().
void GraphBattery3 | ( | Ptr< GenericBatteryModel > | es | ) |
Definition at line 94 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset3, GraphBattery3(), ns3::Simulator::IsFinished(), ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by GraphBattery3().
void GraphBattery4 | ( | Ptr< GenericBatteryModel > | es | ) |
Definition at line 108 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset4, ns3::Time::GetMinutes(), GraphBattery4(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by GraphBattery4().
void GraphBattery5 | ( | Ptr< GenericBatteryModel > | es | ) |
Definition at line 123 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset5, ns3::Time::GetHours(), GraphBattery5(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by GraphBattery5().
Gnuplot2dDataset battDischDataset1 |
Definition at line 44 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery1().
Gnuplot2dDataset battDischDataset2 |
Definition at line 48 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery2().
Gnuplot2dDataset battDischDataset3 |
Definition at line 52 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery3().
Gnuplot2dDataset battDischDataset4 |
Definition at line 56 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery4().
Gnuplot2dDataset battDischDataset5 |
Definition at line 60 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery5().
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:
Definition at line 43 of file generic-battery-discharge-example.cc.
Definition at line 47 of file generic-battery-discharge-example.cc.
Definition at line 51 of file generic-battery-discharge-example.cc.
Definition at line 55 of file generic-battery-discharge-example.cc.
Definition at line 59 of file generic-battery-discharge-example.cc.