#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. More... | |
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 72 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset1, ns3::Time::GetMinutes(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
void GraphBattery2 | ( | Ptr< GenericBatteryModel > | es | ) |
Definition at line 87 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset2, ns3::Time::GetMinutes(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
void GraphBattery3 | ( | Ptr< GenericBatteryModel > | es | ) |
Definition at line 102 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset3, ns3::Simulator::IsFinished(), ns3::Simulator::Schedule(), and ns3::Seconds().
void GraphBattery4 | ( | Ptr< GenericBatteryModel > | es | ) |
Definition at line 116 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset4, ns3::Time::GetMinutes(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
void GraphBattery5 | ( | Ptr< GenericBatteryModel > | es | ) |
Definition at line 131 of file generic-battery-discharge-example.cc.
References ns3::Gnuplot2dDataset::Add(), battDischDataset5, ns3::Time::GetHours(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
Gnuplot2dDataset battDischDataset1 |
Definition at line 52 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery1().
Gnuplot2dDataset battDischDataset2 |
Definition at line 56 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery2().
Gnuplot2dDataset battDischDataset3 |
Definition at line 60 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery3().
Gnuplot2dDataset battDischDataset4 |
Definition at line 64 of file generic-battery-discharge-example.cc.
Referenced by GraphBattery4().
Gnuplot2dDataset battDischDataset5 |
Definition at line 68 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:
$> gnuplot <plotname>.plt
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.
Definition at line 63 of file generic-battery-discharge-example.cc.
Definition at line 67 of file generic-battery-discharge-example.cc.