13#include "ns3/basic-energy-source.h"
14#include "ns3/core-module.h"
15#include "ns3/internet-module.h"
16#include "ns3/netanim-module.h"
17#include "ns3/network-module.h"
18#include "ns3/point-to-point-layout-module.h"
19#include "ns3/point-to-point-module.h"
20#include "ns3/simple-device-energy-model.h"
21#include "ns3/udp-echo-helper.h"
52 void DoRun()
override;
137 pointToPoint.SetDeviceAttribute(
"DataRate",
StringValue(
"5Mbps"));
138 pointToPoint.SetChannelAttribute(
"Delay",
StringValue(
"2ms"));
141 devices = pointToPoint.Install(
m_nodes);
147 address.SetBase(
"10.1.1.0",
"255.255.255.0");
225 const double remainingEnergy =
m_energySource->GetRemainingEnergy();
231 "Wrong remaining energy value was traced");
virtual void CheckFileExistence()
Check file existence.
AbstractAnimationInterfaceTestCase(std::string name)
Constructor.
AnimationInterface * m_anim
animation
const char * m_traceFileName
trace file name
NodeContainer m_nodes
the nodes
virtual void CheckLogic()=0
Check logic function.
~AbstractAnimationInterfaceTestCase() override
Destructor.
virtual void PrepareNetwork()=0
Prepare network function.
void DoRun() override
Implementation to actually run this TestCase.
Animation Interface Test Case.
AnimationInterfaceTestCase()
Constructor.
void CheckLogic() override
Check logic function.
void PrepareNetwork() override
Prepare network function.
AnimationInterfaceTestSuite()
Animation Remaining Energy Test Case.
const double m_initialEnergy
initial energy
AnimationRemainingEnergyTestCase()
Constructor.
Ptr< SimpleDeviceEnergyModel > m_energyModel
energy model
Ptr< BasicEnergySource > m_energySource
energy source
void CheckLogic() override
Check logic function.
void PrepareNetwork() override
Prepare network function.
Interface to network animator.
static void SetConstantPosition(Ptr< Node > n, double x, double y, double z=0)
Helper function to set Constant Position for a given node.
holds a vector of ns3::Application pointers.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Build a set of PointToPointNetDevice objects.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Hold variables of type string.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
TestCase(const TestCase &)=delete
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
static constexpr auto UNIT
Create an application which sends a UDP packet and waits for an echo of this packet.
Create a server application which waits for input UDP packets and sends them back to the original sen...
Hold an unsigned integer type.
AnimationInterfaceTestSuite g_animationInterfaceTestSuite
the test suite
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.