23 #include "ns3/core-module.h"
24 #include "ns3/network-module.h"
25 #include "ns3/internet-module.h"
26 #include "ns3/point-to-point-module.h"
27 #include "ns3/netanim-module.h"
28 #include "ns3/applications-module.h"
29 #include "ns3/point-to-point-layout-module.h"
30 #include "ns3/basic-energy-source.h"
31 #include "ns3/simple-device-energy-model.h"
77 virtual void CheckFileExistence ();
83 TestCase (name), m_anim (NULL), m_traceFileName (
"netanim-test.xml")
102 Simulator::Destroy ();
147 AnimationInterface::SetConstantPosition (
m_nodes.
Get (0), 0 , 10);
148 AnimationInterface::SetConstantPosition (
m_nodes.
Get (1), 1 , 10);
161 address.SetBase (
"10.1.1.0",
"255.255.255.0");
216 m_initialEnergy (100)
232 AnimationInterface::SetConstantPosition (
m_nodes.
Get (0), 0 , 10);
249 "Wrong remaining energy value was traced");
Abstract Animation Interface Test Case.
virtual void DoRun(void)
Implementation to actually run this TestCase.
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 ~AbstractAnimationInterfaceTestCase()
Destructor.
virtual void CheckLogic()=0
Check logic function.
virtual void PrepareNetwork()=0
Prepare network function.
Animation Interface Test Case.
AnimationInterfaceTestCase()
Constructor.
virtual void CheckLogic()
Check logic function.
virtual void PrepareNetwork()
Prepare network function.
Animation Interface Test Suite.
AnimationInterfaceTestSuite()
Animation Remaining Energy Test Case.
virtual void PrepareNetwork()
Prepare network function.
const double m_initialEnergy
initial energy
virtual void CheckLogic()
Check logic function.
AnimationRemainingEnergyTestCase()
Constructor.
Ptr< SimpleDeviceEnergyModel > m_energyModel
energy model
Ptr< BasicEnergySource > m_energySource
energy source
Interface to network animator.
double GetNodeEnergyFraction(Ptr< const Node > node) const
Get node's energy fraction (This used only for testing)
uint64_t GetTracePktCount()
Get trace file packet count (This used only for testing)
holds a vector of ns3::Application pointers.
virtual double GetRemainingEnergy(void)
void SetInitialEnergy(double initialEnergyJ)
void AppendDeviceEnergyModel(Ptr< DeviceEnergyModel > deviceEnergyModelPtr)
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.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Build a set of PointToPointNetDevice objects.
void SetCurrentA(double current)
virtual void SetEnergySource(Ptr< EnergySource > source)
Sets pointer to EnergySouce installed on node.
Hold variables of type string.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
AttributeValue implementation for Time.
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.
#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...
AnimationInterfaceTestSuite g_animationInterfaceTestSuite
the test suite
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.