23 #include "ns3/ascii-test.h" 24 #include "ns3/trace-helper.h" 25 #include "ns3/double.h" 26 #include "ns3/uinteger.h" 27 #include "ns3/string.h" 28 #include "ns3/simulator.h" 29 #include "ns3/rectangle.h" 30 #include "ns3/mobility-model.h" 31 #include "ns3/mobility-helper.h" 32 #include "ns3/node-container.h" 52 virtual void DoRun (
void);
57 TestCase (
"Mobility Trace Test Case")
75 mobility.SetPositionAllocator (
"ns3::GridPositionAllocator",
82 mobility.SetMobilityModel (
"ns3::RandomWalk2dMobilityModel",
85 "Speed",
StringValue (
"ns3::ConstantRandomVariable[Constant=1.0]"),
96 MobilityHelper::EnableAsciiAll (ascii.
CreateFileStream (testMobilityFilePath));
97 Simulator::Stop (
Seconds (5.0));
99 Simulator::Destroy ();
Manage ASCII trace files for device models.
Mobility Trace Test Suite.
Hold variables of type string.
Mobility Trace Test Case.
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits. ...
AttributeValue implementation for Rectangle.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Hold an unsigned integer type.
#define NS_ASCII_TEST_EXPECT_EQ(gotFilename, expectedFilename)
Test that a pair of new/reference ascii files are equal.
static MobilityTraceTestSuite mobilityTraceTestSuite
the test suite
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
std::string CreateDataDirFilename(std::string filename)
Construct the full path to a file in the data directory.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Helper class used to assign positions and mobility models to nodes.
std::string CreateTempDirFilename(std::string filename)
Construct the full path to a file in a temporary directory.
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetDataDir(std::string directory)
Set the data directory where reference trace files can be found.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
virtual ~MobilityTraceTestCase()
This class can be used to hold variables of floating point type such as 'double' or 'float'...