#include "ns3/core-module.h"#include "ns3/energy-module.h"#include "ns3/internet-module.h"#include "ns3/mobility-module.h"#include "ns3/network-module.h"#include "ns3/wifi-radio-energy-model-helper.h"#include "ns3/yans-wifi-helper.h"#include <fstream>#include <iostream>#include <string>#include <vector>Go to the source code of this file.
| Functions | |
| static void | GenerateTraffic (Ptr< Socket > socket, uint32_t pktSize, Ptr< Node > n, uint32_t pktCount, Time pktInterval) | 
| void | HarvestedPower (double oldValue, double harvestedPower) | 
| Trace function for the power harvested by the energy harvester. | |
| static std::string | PrintReceivedPacket (Address &from) | 
| Print a received packet. | |
| void | ReceivePacket (Ptr< Socket > socket) | 
| void | RemainingEnergy (double oldValue, double remainingEnergy) | 
| Trace function for remaining energy at node. | |
| void | TotalEnergy (double oldValue, double totalEnergy) | 
| Trace function for total energy consumption at node. | |
| void | TotalEnergyHarvested (double oldValue, double totalEnergyHarvested) | 
| Trace function for the total energy harvested by the node. | |
$ ./ns3 run "energy-model-with-harvesting-example [Program Options]"
--phyMode  --Prss  --PacketSize  --numPackets  --startTime  --distanceToRx  --verbose  Definition in file energy-model-with-harvesting-example.cc.
| 
 | static | 
| socket | Pointer to socket. | 
| pktSize | Packet size. | 
| n | Pointer to node. | 
| pktCount | Number of packets to generate. | 
| pktInterval | Packet sending interval. | 
Traffic generator.
Definition at line 103 of file energy-model-with-harvesting-example.cc.
References ns3::Create(), GenerateTraffic(), pktSize, and ns3::Simulator::Schedule().
Trace function for the power harvested by the energy harvester.
| oldValue | Old value | 
| harvestedPower | New value | 
Definition at line 159 of file energy-model-with-harvesting-example.cc.
References ns3::Simulator::Now(), and NS_LOG_UNCOND.
| 
 | inlinestatic | 
Print a received packet.
| from | sender address | 
Definition at line 63 of file energy-model-with-harvesting-example.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::Time::GetSeconds(), and ns3::Simulator::Now().
Referenced by ReceivePacket().
| socket | Pointer to socket. | 
Packet receiving sink.
Definition at line 80 of file energy-model-with-harvesting-example.cc.
References NS_LOG_UNCOND, and PrintReceivedPacket().
Trace function for remaining energy at node.
| oldValue | Old value | 
| remainingEnergy | New value | 
Definition at line 133 of file energy-model-with-harvesting-example.cc.
References ns3::Simulator::Now(), and NS_LOG_UNCOND.
Trace function for total energy consumption at node.
| oldValue | Old value | 
| totalEnergy | New value | 
Definition at line 146 of file energy-model-with-harvesting-example.cc.
References ns3::Simulator::Now(), and NS_LOG_UNCOND.
Trace function for the total energy harvested by the node.
| oldValue | Old value | 
| totalEnergyHarvested | New value | 
Definition at line 172 of file energy-model-with-harvesting-example.cc.
References ns3::Simulator::Now(), and NS_LOG_UNCOND.